WordPress.org

Ready to get started?Download WordPress

Forums

NextGen Gallery pagination directing to post instead of category (2 posts)

  1. visualizingsystems
    Member
    Posted 1 year ago #

    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!

  2. jonyellery
    Member
    Posted 1 year ago #

    I solved this problem with this:

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

Topic Closed

This topic has been closed to new replies.

About this Topic