Custom theme – frontpage pagination not working
-
Problem : I’m trying to display few post on my WP front page, so I used query_post to get post using some filtering argument and it’s giving perfect result. Problem happens when pagination added in this query. First page is showing without any issue but res from page 2 to end it’s just shown a 404 page. If I use same code on another page instead of front page or index.php it’s working fine. The same code also worked on any templates also.
Spec : WP 3.9, xaamp / online server php 5.3
Solution Tried :
- making $paged global, failed.
- using pagination plugin, failed.
- using custom pagination designed by me, failed.
- using page if paged variable not exists, failed.
- using wp_query, failed.
<?php // Get all posts under category testimonials. // The Query global $paged; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $wp_query = new WP_Query(); $wp_query->query('showposts=2'.'&paged='.$paged); /*query_posts( array ( 'posts_per_page' => 2, 'paged' => $paged ) );*/ // The Loop if ( have_posts() ) : while ( have_posts() ) : the_post(); $post_id =get_the_ID(); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom theme – frontpage pagination not working’ is closed to new replies.