Why won’t pagination work?

probably coz you override the default query and forgot to take care of pagination 🙂 change the code this way: $page = isset(get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array( ‘numberposts’ => $numposts, ‘paged’ => $paged ); This should do the work

query_posts pagination will always show identical content

Don’t use query_posts! As Eugene pointed out, you omitted the paged variable. However, even with that in you can get unexpected behaviour. As illustrated by the various questions we get on query_posts and pagination: query_posts and pagination, still stuck after much research Pagination throws 404 Pagination throws 404 error on custom taxonomy archive pages

How do I get my loop.php to properly paginate?

I don’t know what’s inside featured-content-slider.php, but I’m assuming this is the loop you’d like to paginate: query_posts(‘category_name=featured-news’); The issue is that by calling query_posts like this in the template, you’re overwriting the original query for the page and not setting any page parameter. Your two options are to either modify the original query string, … Read more

How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?

In your main loop file, check the $args. It filters the query. you can use the same query on other pages using your own options. suppose, on another page, you want to fetch the posts of a different category. your query parameters may be like: $args = array( ‘post_type’ => ‘post’, ‘cat’ => ‘DIFFERENT_CATEGORY’, ‘posts_per_page’ … Read more

previous_post_link in same taxonomy in custom post type

I’d suggest using a plugin for this. next_post_link and previous_post_link will use the category taxonomy (literally)*, so they will not work as expected with custom taxonomies, which I think you are using here. I’ve used both Smarter Navigation by Scribu and Ambrosite Next/Previous Post Link Plus, which are both great plugins for this sort of … Read more

Replacing global wp_query

Firstly, I’d seriously consider opting for another plugin (it hasn’t been maintained in over 2 years), or making use of WP’s built-in paginate_links. But, in the quest to provide a solution, give this a go: function wp_page_numbers_custom( $wp_query, $start=””, $end = ” ) { $_backup = array( ‘wp_query’ => @ $GLOBALS[‘wp_query’], ‘max_page’ => @ $GLOBALS[‘max_page’], … Read more

Custom Query Not Paginating

You need to set paged or an offset in your query, otherwise you’re always fetching the same 48 posts. $page = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1; $args = array( ‘paged’ => $page, ‘posts_per_page’ => ’48’, ‘cat’ => ‘4’, ‘meta_query’ => array( array( ‘key’ => ‘Country’, ‘value’ => $country_search_array, ‘compare’ => ‘IN’ ) ) ); $gallery_query … Read more

Custom posts not paginating on archive page and returning 404

Your error is likely get_query_var(‘paged’) should be get_query_var(‘page’). However… You should avoid calling query_posts in the template, it is a waste of resources, as you’re just discarding the original query which has already happened. Hook pre_get_posts to instead alter the query before it happens: function wpa60728_pre_get_posts( $query ) { if ( ‘bvdirectory’ == get_post_type() && … Read more

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.