wp-navi works great everywhere except the front(index.php) page!
-
Hello guys!
wp-navi works ok with my custom post type in every page except the front (index.php) page.
Actually it seems like wp-navi have a problem with my current query structure.
if i type:
https://www.mypage.com/page/2/
wp-navi returns 404!But if i try:
https://www.mypace/eshop/page/2
Works ok!Note that “eshop” is my custom post type which i loop in the front page..
So is there a way to make it query “/eshop/page/2” (which works great) instead of “mypage.com/page/2” ??
Here is the code of my index.php:
global $post; $paged = get_query_var('paged') ? get_query_var('paged') : 1; $args = array( 'post_type' => 'eshop', 'posts_per_page' => 8,'paged' => $paged); $loop = new WP_Query( $args ); if($loop->have_posts()) : while ( $loop->have_posts() ) : $loop->the_post();
and my wp-navi code:
<?php wp_pagenavi( array( 'query' =>$loop )); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp-navi works great everywhere except the front(index.php) page!’ is closed to new replies.