Pagination page 2 not found when click nex
-
i am new to wordpress and php.. i am used plugin for WP_Pagnavi for pginataion.. when i clicked next or page 2 it shows page not found
my code is
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme and one
* of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query,
* e.g., it puts together the home page when no home.php file exists.
*
* @link https://codex.www.ads-software.com/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/get_header(); ?>
<div id=”main-content” class=”main-content”>
<?php
if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
// Include the featured content template.
get_template_part( ‘featured-content’ );
}
?><div id=”templatemo_content”>
<?php get_sidebar();?>
<div id=”templatemo_content_column_two”>
<?php
$q = new WP_Query( array( ‘posts_per_page’ => 2, ‘paged’ => get_query_var(‘paged’), ‘cat’=>3));
while ( $q -> have_posts()) : $q -> the_post();
?>
<div class=”column_two_section”><h1>“><?php the_title(); ?></h1>
<div class=”post_info”>
Posted by” target=”_blank”><?php the_author();?>, <?php the_time(‘j F Y’); ?></div>
<?php the_post_thumbnail(); ?>
<p><?php the_excerpt(); ?></p>
<p>Credit goes to photovaco for photos.</p>
<div class=”post_comment”>
<span class=”comment”>18 comments</span>
</div>
</div>
<?php
endwhile;
wp_pagenavi( array( ‘query’ => $q ));
wp_reset_postdata();?>
</div> <!– end of column two –>
<?php get_sidebar(‘right’);?></div>
<?php
get_footer();
please help me to fix this
- The topic ‘Pagination page 2 not found when click nex’ is closed to new replies.