WordPress.org

Support

Support » Plugins and Hacks » NextGen Gallery pagination directing to post instead of category

NextGen Gallery pagination directing to post instead of category

  • Hi, I’m using NextGen Gallery (with the Slimbox plugin) on my category pages. When I test the navigation on the second, third, fourth, etc. pages, the links are directed to the first post on the category pages instead of the category.

    I tried taking a look at nextgen-gallery/lib/navigation.php, but I’m fairly new to wordpress and not sure what I need to use instead of $nggRewrite->get_permalink…get the category ID and do some sort of string concatenation?

    // create navigation
    			if ( $total > $maxElement ) {
    				$total_pages = ceil( $total / $maxElement );
    				$r = '';
    				if ( 1 < $page ) {
    					$args['nggpage'] = ( 1 == $page - 1 ) ? FALSE : $page - 1;
    					$previous = $args['nggpage'];
    					if (FALSE == $args['nggpage']) {
    						$previous = 1;
    					}
    					$this->prev = $nggRewrite->get_permalink ( $args );
    					$r .=  '<a class="prev" id="ngg-prev-' . $previous . '" href="' . $this->prev . '">' . $prev_symbol . '</a>';

    You can see what’s happening here: http://visualizingsystems.com/category/media-type/dataviz/

    Any help would be much appreciated!

Viewing 1 replies (of 1 total)
  • I solved this problem with this:

    <a class="page-numbers" href="' . get_category_link( $args ) . '&nggpage='. array_shift($args) .'">

Viewing 1 replies (of 1 total)
  • The topic ‘NextGen Gallery pagination directing to post instead of category’ is closed to new replies.