Not working on home page with custom post type
-
You may think I am one other how to use paged properly problem maker but believe me before bugging you I almost tried every single solution on internet !
Your pagination is working every where fine expect when I make a page my home page through WordPress setting it stop working.
if ( get_query_var('paged') ) { echo "paged is on"; $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) { echo "paged is off"; $paged = get_query_var('page'); } else { echo "paged is 1"; $paged = 1; } query_posts( array( 'post_type' => 'listing', 'posts_per_page' => get_field('listings_per_page','option'), 'paged' => $paged ) );
This my code when selected as home page it echo “page is 1” when not selected as hopepage pagination working fine and echo “page is on” ? What could be the problem ?
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Not working on home page with custom post type’ is closed to new replies.