[Theme: Sundak] Static front page not paginating.
-
I have searched and searched for a solution to fix this issue, but nothing has worked so far. I contacted the theme developer, but he doesn’t seem to want to do much to offer help.
After searching forums for a solution to the pagination issue, it seems the top solutions people are implementing as a resolve:
-Checking with host to make sure mod_rewrite is enabled. I’ve checked with host, it is.
-Making sure there is nothing in the .htaccess file preventing pagination. I checked and I can’t see any issues:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPressThe only thing I can think of that might be causing pagination to not work properly is the way the custom theme layout pages are coded. In Wp-admin— “Customize”—“Static Front Page” I have “Front Page” set to theme’s custom page template “Masonry (1 of 7 available custom layout options).” The only way pagination works is if I use “Ugly” permalinks. If I try to use any other permalink structure pagination stops working, and when I try to click to get to page 2, 3, 4, etc., they just loop back to the main page and everything is the same.
Here is the entire code for the custom theme page layout “Masonry”:
<?php
/*
* Template Name: Blog: Masonry
*/
?>
<?php get_header(); ?><div class=”main-content-wrap”>
<div class=”main-content”><?php
// before blog content sidebar
if( is_active_sidebar( ‘sidebar-before-blog’ ) ) {
dynamic_sidebar( ‘sidebar-before-blog’ );
}// pagination parameter
if ( get_query_var(‘paged’) ) { $paged = get_query_var(‘paged’); }
elseif ( get_query_var(‘page’) ) { $paged = get_query_var(‘page’); }
else { $paged = 1; }// run the query
$query = new WP_Query(
array(
‘posts_per_page’ => get_option( ‘posts_per_page’ ),
‘ignore_sticky_posts’ => true,
‘paged’ => $paged,
));// process the query
if( $query->have_posts() ) {
echo ‘<div class=”posts-wrap posts-wrap-masonry row”>’;
while( $query->have_posts() ) {
$query->the_post();// load the content
echo ‘<div class=”col-6″>’;
get_template_part( ‘content’ );
echo ‘</div>’;
}
echo ‘</div>’;// pagination
sundak_pagination( $query );
} else {
get_template_part( ‘content’, ‘none’ );
}// reset query
wp_reset_postdata();
?></div>
</div><?php get_sidebar(); ?>
<?php get_footer(); ?>I’m losing my mind trying to figure out how to make pagination work, any help is greatly appreciated.
- The topic ‘[Theme: Sundak] Static front page not paginating.’ is closed to new replies.