Home>Support>Category and Tags ‘page 2’ not working

Category and Tags ‘page 2’ not working

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hello,

I have a small problem. On my tags/category archive pages, selecting ‘page 2’ or ‘page 3’ or ‘next’ just defaults back to the first page.

I’m sure this is probably a quick fix but I’m not sure what’s going on…

An example page is: http://test.naturespy.org/tag/yorkshire-pine-marten-project/

Thanks,

James

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 11 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Hi James

    Please head to Dashboard > Updates, update everything there.
    Head to Settings > Permalinks, hit save.
    Try temporarily disabling all plugins except for Page Builder and see if the issue resolves. If it does, enable plugins one at a time while checking the problem.

    No luck with all of the above? Please can you reduce the posts displayed on a page so I can see the problem in action at the link you sent.

  2. 11 years, 2 months ago Nature Spy

    Hi Andrew,

    Tried the first two suggestions, and no change.

    Changed it back so you can see the page I posted properly. It is only happening on the tag pages, not on the category pages.

    I’m concerned about disabling widgets as they’re used a lot across the site and I don’t want to have to do them again – will everything go back to normal if I disable and re-enable them?

    Thanks again for your help,

    James

  3. 11 years, 2 months ago Nature Spy

    Just to add – page 2 does work, but only when you enter the URL in the address bar; its the button itself that doesnt seem to be working (both ‘2’ and ‘Next’)

    Thanks again,

  4. 11 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for reporting this James. There is a second forward slash being added to the url of those buttons. It’s a bug. We’ll have it fixed in the next update of Vantage. Apologies for the hassle. Please re-test the next time you update.

  5. 11 years, 2 months ago Nature Spy

    Not a problem, thanks for getting back so quick – is there any way for me to make the edit in the appropriate php file for now?

    I can see which one it would be…

  6. 11 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    In wp-content/themes/vantage/inc/template-tags.php swap out line 378 onwards with the below:

    if( !function_exists( 'vantage_pagination' ) ) :
    /**
     * Display the pagination
     *
     * @param string $pages
     * @param int $range
     */
    function vantage_pagination($pages = '', $range = 2) {
    
    	$showitems = ($range * 2)+1;
    
    	global $wp_query, $wp_rewrite;
    	$paged = $wp_query->get('paged');
    	if(empty($paged)) $paged = 1;
    
    	if($pages == '') {
    		global $wp_query;
    		$pages = $wp_query->max_num_pages;
    		if(!$pages) $pages = 1;
    	}
    
    	if(1 != $pages) {
    		$format_permalink = substr( get_pagenum_link(false), -1, 1 ) == '/' ? 'page/%#%/' : '/page/%#%/';
    		$format_query_string = strpos(get_pagenum_link(false), '?') === false ? '?paged=%#%' : '&paged=%#%';
    
    		echo "<div class='pagination'>";
    		echo paginate_links( array(
    			'total' => $pages,
    			'current' => $paged,
    			'mid_size' => $showitems,
    			'format' => ( $wp_rewrite->permalink_structure == '' || is_search() ) ? $format_query_string : $format_permalink,
    			'base' => get_pagenum_link(false).'%_%',
    		) );
    		echo "</div>\n";
    	}
    }
    endif;
  7. 11 years, 2 months ago Nature Spy

    Hi Andrew,

    I appreciate that – but unfortunately it made the website stop working, so I’ve had to revert to the backup. Not sure why, but tried it a few times.

    If it helps you guys fix the bug, the error is the slash on line 405, in front of the last ‘page’ on that line.

    Thanks again for your help – wouldn’t have known where to look without your support.

    Best theme, best support!

    James

  8. 11 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Sorry about that.

    It sounds like you’ve resolved the issue. In case I mis-understood please replace template-tags.php with my copy here: https://dl.dropboxusercontent.com/u/3072682/template-tags.php.

    Thanks again for pointing this out.

  9. 11 years, 2 months ago Nature Spy

    Please, no need to apologise; wouldn’t have figured it out without your help.

    Yes, resolved and thanks again.

  10. 11 years, 2 months ago Andrew Misplon
    Hi, I Work Here

    Super, glad we could help here. All the best with your project.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More