Getting pagination to work and show up with this query
-
I would like to paginate this query but I get no links for pagination at the end of the list of posts fetched. How can I fix it?
$test_items = new WP_Query( array( 'post_type' => 'test_feed_item', 'posts_per_page' => $settings['feed_limit'], 'orderby' => 'meta_value', 'meta_key' => 'test_item_date', 'order' => 'DESC', 'paged' => get_query_var('page') ? get_query_var('page') : 1, ) ); if( $test_items->have_posts() ) { while ( $test_items->have_posts() ) { $test_items->the_post(); $permalink = get_post_meta( get_the_ID(), 'test_item_permalink', true ); } echo paginate_links(); wp_reset_postdata(); } else { echo 'No feed items found'; }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Getting pagination to work and show up with this query’ is closed to new replies.