Nextgen Gallery: Paging (navigation) problem within gallery
-
Hello,
I use NextGen Gallery plugin and have a problem with navigation within one gallery. I have many images (~100p) and images are divided into several pages, but navigation (paging) does not work correctly.
http://retlar.ee/wp/referentsiden/ – here is a gallery.
When I click on pages or arrows, it shows me a post instead of the next page with my photos.
This is a link, which currently shows:
http://www.retlar.ee/wp/huiskula-lillepood/?nggpage=2
This is a link, which should be:
http://www.retlar.ee/wp/referentsiden/?nggpage=2I saw many similar questions, but no answers. Please help.
-
The problem is with JavaScript, which does not allow shortcode to work. I tried to put the same code to other page and pagination works perfectly, so I decided, that the problem is with JavaScript on the Portfolio page.
Here is my code:
<?php get_header(); /* Template Name: Portfolio */ ?> <div class="title-line"> <span class="page-title-text more-padd"><?php echo the_title();?></span><div class="title-width-line"></div> <div class="clear-both"></div> </div> <div id="wraper-inside"> <div id="wraper-holder-wide"> <?php if(isset($_SESSION['showlineforportfolio'])) { $_SESSION['showlineforportfolio'] ?> <div id="horizontal-line" class="horizontal-line-wide"></div> <?php } ?> <!-- CATEGORY PRINT --> <div class="portfolio-cat-holder"> <img alt="category image" class="cat-img" src="<?php echo get_template_directory_uri(); ?>/style/img/categories.png" /> <ul id="filter"> <!--<li class="cat_cell" style="" data-filter="all" >All</li>--> <?php wp_reset_query(); $portfolio_category = get_option(THEME_NAME.'_portfolio_include_category'); /*CATEGORY INCLUDE OR EXCLUDE: ('orderby=name&include=9')*/ $categories = get_categories('orderby=name'); $include_category = null; $slug = get_page_link(); foreach ($categories as $category_list) { $showall = 0; if($showall == 1) { if(!empty($portfolio_category[0][$category_list->cat_ID])) { $cat = $category_list->cat_ID.","; $include_category = $include_category.$cat; echo '<li class="cat_cell" data-filter="'.$category_list->cat_ID.'">'.$category_list->cat_name.'</li>'; } }else { $add = 1; /*add=1, then no 2005 & 2007*/ if(!empty($portfolio_category[0][$category_list->cat_ID])) { $args=array('cat'=>$category_list->cat_ID, 'post_status' => 'publish','meta_key' => '_thumbnail_id'); query_posts($args); echo $args[0]; if ( have_posts() ) : while ( have_posts() ) : the_post(); /* <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" /> <?php } ?> */ /*<?php if ( has_post_thumbnail() ) the_post_thumbnail(); else echo '<img src="' . trailingslashit( get_stylesheet_directory_uri() ) . 'images/default-thumbnail.png' . '" alt="" />'; ?> */ if (has_post_thumbnail()) { $imagedata = simplexml_load_string(get_the_post_thumbnail()); $post_img = $imagedata->attributes()->src; if(!empty($post_img)) { $add = 1; } } endwhile;?> <?php else: endif; if($add == 1) { $include_category = $include_category.$cat; echo $include_category; echo '<li class="cat_cell" data-filter="'.$category_list->cat_ID.'">-'.$category_list->cat_name.'</li>'; } } } }?> </ul> </div> <!-- /CATEGORY PRINT --> <script type="text/javascript"> jQuery(document).ready(function($){ var $data = $("#portfolio-holder").clone(); $('#portfolio-holder').css('height','800px'); var $filteredData = $data.find('.portfolio_box[data-type=' + 10 + ']'); $("#portfolio-holder").quicksand($filteredData, { duration: 500, easing: 'swing', adjustHeight: 'false' },function(){ $('#portfolio-holder').css('height','auto'); $('.fancybox-overlay,.fancybox-wrap,.fancybox-loading,.fancybox-tmp').remove(); jQuery('.fancybox').fancybox(); }); $('#filter li').click(function(e) { $('#portfolio-holder').css('height','800px'); var filterClass=$(this).attr('data-filter'); /* if (filterClass == 'all') { var $filteredData = $data.find('.portfolio_box'); } else { var $filteredData = $data.find('.portfolio_box[data-type=' + filterClass + ']'); } */ var $filteredData = $data.find('.portfolio_box[data-type=' + filterClass + ']'); $("#portfolio-holder").quicksand($filteredData, { duration: 400, easing: 'swing', adjustHeight: 'false' },function(){ $('#portfolio-holder').css('height','auto'); $('.fancybox-overlay,.fancybox-wrap,.fancybox-loading,.fancybox-tmp').remove(); jQuery('.fancybox').fancybox(); }); jQuery('img','.pirobox').live({ mouseenter: function() { jQuery(this).stop().animate({opacity:0.4},500); }, mouseleave: function() { jQuery(this).stop().animate({opacity:1},300); } } ); return false; }); }); </script> <div id="portfolio-holder-relative"> <div id="portfolio-holder" > <?php // wp_reset_query(); if(!empty($portfolio_category[0])) { foreach ($portfolio_category[0] as $x => $y) { if(!isset($categories_for_queue)) { $categories_for_queue = $x; }else { $categories_for_queue .= ','.$x; } } } $numportfolio = get_option(THEME_NAME.'_number_of_images_portfolio'); $url = get_page_url(); $showall = get_option(THEME_NAME.'_show_without_images_portfolio'); if(!isset($showall) || $showall !== 1) { $args=array('cat'=>$categories_for_queue, 'post_status' => 'publish','posts_per_page' => 300 ,'meta_key' => '_thumbnail_id'); query_posts($args); } $i=0; $z=1; if ( have_posts() ) : while ( have_posts() ) : the_post(); if (has_post_thumbnail()) { $imagedata = simplexml_load_string(get_the_post_thumbnail()); $post_img = $imagedata->attributes()->src; }else { $post_img = ""; } $i++; foreach(get_the_category() as $category) { $cat = $category->cat_ID." "; } $trimmed = trim($cat); ?> <div class="portfolio_box <?php echo $cat;?> portfolio_box_one portfolio_box-3colSimple" data-type="<?php echo $trimmed; ?>" data-id="box-<?php echo $i; ?>" > <p class="portfolioList"> <?php /*?><a href="<?php the_permalink(); ?>" id="post-<?php the_ID(); ?>" <?php post_class(); ?>><?php */?> <?php /* $thetitle = get_the_title(); $getlength = strlen($thetitle); $thelength = 500; echo substr($thetitle, 0, $thelength); if ($getlength > $thelength) echo "..."; */ $thetitle = get_the_title(); echo ($thetitle); ?> </p> </div> <?php $z++; endwhile; ?> <?php else: ?> <?php endif; ?> </div> <!-- Gallery --> <div class="rigth_col"> <?php echo do_shortcode('[nggallery id=4]'); ?> </div> <!-- /Gallery --> </div> </div> </div> <div class="clear-both"></div> <?php get_footer(); ?>
The gallery is placed by code:
<?php echo do_shortcode('[nggallery id=4]'); ?>
I found that
<?php echo do_shortcode('[nggallery id=4]'); ?>
works perfect when code placed above is removed, and now I need to find a solution, how can I isolate the code of gallery or the code for posts displaying..
Any ideas?
- The topic ‘Nextgen Gallery: Paging (navigation) problem within gallery’ is closed to new replies.