• I am using NextGEN Gallery plugin which works perfectly.

    Now I put my own code into header.php for header slider and suddenly there are problems with galleries: when I click on image it opens “in full width” instead of “image viewer”.

    I am sure it’s because of jQuery loading twice.

    This is what I have in functions.php:

    add_action('init', 'add_javascript');
    
        function add_javascript() {
            // Add JQuery
            wp_enqueue_script('jquery');
    
            // Add the scripts
            $js_url = get_bloginfo('stylesheet_directory') . '/js';
            wp_enqueue_script('jquery-min',"$js_url/jquery.min.js");
            wp_enqueue_script('responsiveslides',"$js_url/responsiveslides.min.js");
        }

    This is what I have in header.php:

    <!DOCTYPE html>
    <!--[if IE 7]>
    <html class="ie ie7" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if IE 8]>
    <html class="ie ie8" <?php language_attributes(); ?>>
    <![endif]-->
    <!--[if !(IE 7) | !(IE 8)  ]><!-->
    <html <?php language_attributes(); ?>>
    <!--<![endif]-->
    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    	<meta name="viewport" content="width=device-width">
    	<title><?php wp_title( '|', true, 'right' ); ?></title>
    	<link rel="profile" href="https://gmpg.org/xfn/11">
    	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    	<!--[if lt IE 9]>
    	<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
    	<![endif]-->
    	<?php wp_head(); ?>
      <script>
        $(function () {
          $("#slider").responsiveSlides({
            maxwidth: 3200,
            speed: 800
          });
        });
      </script>
    <script>
    jQuery(document).ready(function($){
        $(window).scroll(function(){
            if ($(this).scrollTop() > 50) {
                $('.backToTop').fadeIn('slow');
            } else {
                $('.backToTop').fadeOut('slow');
            }
        });
        $('.backToTop').click(function(){
            $("html, body").animate({ scrollTop: 0 }, 500);
            return false;
        });
    });
    </script>
    </head>

    Any idea how to put the code so both header slider and NGgallery would work?

    [Moderator Note: No bumping. If it’s that urgent after waiting just 1 hour, consider hiring someone instead.]

  • The topic ‘[NextGEN Gallery] Conflicts with my own script’ is closed to new replies.