Possible Cause of WordPress Jetpack Plugin Pagination Error

P

Back in July 2011 I noticed a problem with the Jetpack plugin and page navigation. In short, with the Jetpack plugin activated page navigation worked only if I was logged-in as admin. When logged-out page urls were being incorrectly re-written and causing 404 Not Found errors.

Now, some 9 months after having first raised the issue over at the WordPress.org forums member Josh Eaton seems to have found a possible cause.

To have blog posts displayed on the front page, the theme I use requires that A static page is selected in Reading Settings:

Reading Settings with Front page displays set to A static page

Reading Settings with Front page displays set to A static page

 

 

The theme’s wp-content/themes/infocus-v16-prod/index.php file then chooses the appropriate template based on these settings:

<?php 
get_header();
require(WEBTREATS_INCLUDES . "/var.php");

$show_on_front = get_option('show_on_front');
$page_on_front = get_option('page_on_front');

if( ($show_on_front == 'page') && ($page_on_front == $blog_page) ) {
	require(WEBTREATS_INCLUDES . "/template-blog.php");
}else{
	require(WEBTREATS_INCLUDES . "/featured-" .$homepage_slider. ".php");
get_footer();
}

?>

The original inFocus v1.60 wp-content/themes/infocus-v16-prod/index.php file

 

 

Using this configuration I was experiencing issues with page navigation. Josh’s suggestion was to have Your latest posts selected in Reading Settings:

Reading Settings with Front page displays set to Your latest posts

Reading Settings with Front page displays set to Your latest posts

 

 

For my theme I also needed to change wp-content/themes/infocus-v16-prod/index.php so that /wp-content/themes/infocus-v16-prod/lib/includes/template-blog.php was still being used despite A static page no longer being selected in Reading Settings.

Commenting-out the option for use of the other template has no adverse affect on my site as the site’s configuration renders this alternative redundant.

<?php 
get_header();
require(WEBTREATS_INCLUDES . "/var.php");

$show_on_front = get_option('show_on_front');
$page_on_front = get_option('page_on_front');

if( ($show_on_front == 'page') && ($page_on_front == $blog_page) ) {
	require(WEBTREATS_INCLUDES . "/template-blog.php");
}else{
//	require(WEBTREATS_INCLUDES . "/featured-" .$homepage_slider. ".php");
	require(WEBTREATS_INCLUDES . "/template-blog.php");
get_footer();
}

?>

The amended inFocus v1.60 wp-content/themes/infocus-v16-prod/index.php file

 

 

While this fix may not get to the root of the issue and admittedly it feels more like a hack than a solution, it certainly allows the Jetpack plugin to play nice with page navigation on this site.

WordPress 3.x Page Navigation Error with inFocus Theme: Revisited may also be of interest as it documents a possibly related issue.

About the author

A native Brit exiled in Japan, Steve spends too much of his time struggling with the Japanese language, dreaming of fish & chips and writing the occasional blog post he hopes others will find helpful.

Add comment

Steve

Recent Comments

Recent Posts