jQuery Slider in Genesis Child Theme

Community Forums Forums General Discussion jQuery Slider in Genesis Child Theme

This topic is: not resolved

Tagged: 

This topic contains 5 replies, has 3 voices, and was last updated by  jimena 1 month, 3 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #91716

    walkingmiller
    Participant

    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

    #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!

    #158723

    braddalton
    Participant
    #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

    #158753

    braddalton
    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.


    #158789

    jimena
    Participant

    Thank you very much , it worked perfect!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.