• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

jQuery Slider in Genesis Child Theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › jQuery Slider in Genesis Child Theme

This topic is: not resolved

Tagged: jquery

  • This topic has 5 replies, 3 voices, and was last updated 7 years, 8 months ago by jimena.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • February 21, 2014 at 11:31 am #91716
    walkingmiller
    Member

    Hello. I am porting over a site from a .net cms into a genesis child theme. The element of their old site that they were most excited about was a fancy jQuery slider that used a sliding accordion, thumbnail navigation (quite a mouthful). I am using slider revolution for the actual slider, and I am trying to use the code from the previous site for the navigation. Unfortunately, the navigation does not want to work (see below for a screenshot). I have loaded the javascript and style sheet through wp_register and wp_enqueue, but there seems to still be an issue. Here is the code in my functions.php:

    add_action( 'wp_enqueue_scripts', 'scp_enqueue_ch_script');
    function scp_enqueue_ch_script() {
    wp_register_script('stage_set', get_stylesheet_directory_uri() . '/js/stage.set.js', array( 'jquery' ), '', true );
    wp_register_script('stage', get_stylesheet_directory_uri() . '/js/stage.js', array( 'jquery' ), '', true );
    wp_register_style('stage_css', get_stylesheet_directory_uri() . '/stage.css', '', '', 'screen');

    wp_enqueue_script( 'stage_set');
    wp_enqueue_script( 'stage');
    wp_enqueue_style( 'stage_css');
    }

    Here is a fiddle for what is supposed to happen (I pasted both stage_set.js and stage.js into the same javascript field) -

    Unfortunately, when I load the page with the appropriate code, here is a screenshot of what happens - The thumbnail navigation does not respond in any way.

    The site seems to be loading the javascript, but there appears to be an issue with the way it is reading the javascript. I would appreciate any help. I wish the client wasn't so stuck on the particular navigation style, but they are insisting on using it. Please let me know if I can provide any further information.

    Thank you,
    walkingmiller

    July 6, 2015 at 1:58 pm #158540
    jimena
    Participant

    Hi There!

    I have a question about the Backstretch.js code, make it on my site and it works perfect , but it works on every page, and I just want it to work on home page. Any help on how to do this?

    Thanks!

    July 7, 2015 at 5:38 pm #158723
    Brad Dalton
    Participant

    Add the

    is_front_page()

    conditional tag after the function.

    Example http://codex.wordpress.org/Function_Reference/is_front_page#Examples


    Tutorials for StudioPress Themes.

    July 7, 2015 at 9:50 pm #158749
    jimena
    Participant

    Hi Braddalton, Thanks for your help, but I can´t add the conditional tag after the function .

    I´m using the theme agent press pro , this is the php code :

    //* Add conditional rotating background images if static background image is not found
    if (!get_background_image() ) {
    add_action( 'wp_enqueue_scripts', 'wap_backstretch' );
    function wap_backstretch() {
    	wp_enqueue_script( 'backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
    	wp_enqueue_script( 'backstretch-init', get_stylesheet_directory_uri() . '/js/backstretch-init.js', array( 'backstretch' ), '1.0.0' );
    }
    }

    http://www.delpropiedades.cl

    July 7, 2015 at 11:10 pm #158753
    Brad Dalton
    Participant

    Why?

    add_action( 'wp_enqueue_scripts', 'wap_backstretch' );
    function wap_backstretch() {
    if ( ! get_background_image() OR is_front_page() ) {
    	wp_enqueue_script( 'backstretch', get_bloginfo( 'stylesheet_directory' ) . '/js/backstretch.js', array( 'jquery' ), '1.0.0' );
    	wp_enqueue_script( 'backstretch-init', get_stylesheet_directory_uri() . '/js/backstretch-init.js', array( 'backstretch' ), '1.0.0' );
        }
    }
    

    Try change the

    OR

    to

    AND

    if needed.

    Something like this. Not tested but you can use this code as a guide for testing.


    Tutorials for StudioPress Themes.

    July 8, 2015 at 9:15 am #158789
    jimena
    Participant

    Thank you very much , it worked perfect!

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble