WordPress.org

Ready to get started?Download WordPress

Forums

Image Slider JQuery problem (3 posts)

  1. Dbo111
    Member
    Posted 1 year ago #

    Hi, I am trying to implement a meta slider on this site: http://seguinmoreaunapa.com. I am using the free version. The theme is a custom one built on twenty eleven. If I put the code in the theme homepage.php the slider does not display. If I use the shortcode and just put it into a page it works brilliantly. I am not sure if there is a jQuery script loading twice. I posted on the plugins forum but have not heard back. I am trying not to buy the pro version for $19. Any ideas? Thanks.

  2. Shaun Scovil
    Member
    Posted 1 year ago #

    It looks like you're trying to use Nivo Slider, but you haven't loaded the .js file.

    You will want to upload the .js file somewhere on your web server (in your theme's folder, in a sub-folder called 'js' maybe?), then load it using wp_enqueue_script in your theme's functions.php file.

    Example:

    function load_my_scripts() {
        wp_enqueue_script(
            $handle = 'nivo_slider',
            $src    = get_stylesheet_directory_uri() . '/js/jquery.nivo.slider.js',
            $deps   = array( 'jquery' )
        );
    }
    add_action( 'wp_enqueue_scripts', 'load_my_scripts' );

    It looks like there is also some CSS that needs to be loaded for Nivo Slider. Use wp_enqueue_style for that.

  3. Dbo111
    Member
    Posted 1 year ago #

    Hi Shaun,

    Why does the test slider work on just a normal page, but not on the homepage?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.