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() && is_main_query() )
$query->set( 'posts_per_page', 2 );
}
add_action( 'pre_get_posts', 'wpa60728_pre_get_posts' );
Related Posts:
- How to disable pagination (next/previous links) on post type archive?
- Pagination not working past page 3 on archive page of category
- WordPress /page/2 404 pagination problem – what to do?
- how to get pagination link url?
- add_rewrite_rule – working fine but broken for pagination
- Check if on last page of paginated post using wp_link_pages
- How to paginate a list of tags
- How do I sort multiples pages?
- WordPress pagination on custom script
- Broken pagination
- pagenavigation not showing the next page just linking back to the main page [closed]
- Paginate get related post by author function
- How to use pre_get_posts?
- Keep Pagination in Tabs
- Need help understanding pagination parameters
- redirect pages with no content, instead of 404 error, using max_num_posts?
- WordPress API returns empty page when page is less than X-WP-TotalPages
- Custom query in archive.php with pagination nightmare
- Display only the current page number and another numbered page in pagination
- Display post links under month in paginated archive
- Pagination (page/2/) displaying 404 on archive pages
- How to use “offset” to paginate get_users?
- How to test pagination? [closed]
- Limited number of paging to 10 “pages: 1 … 10”
- remove_query_arg() on rewrite rule
- Hide featured post on second page
- I cannot get pagination to work on my home page code. it keeps displaying the same posts
- How to get “last year from [spec year] that has posts”?
- Pagination url canonical problem
- Fetching more posts in WordPress via AJAX
- AJAX pagination offset returns same post on adjacent pages
- 404 on pagination but with a strange twist (error 404 only when there is single post on the second page)
- Add additional first page, last page links to the_posts_pagination()
- wp_title() returns ‘page not found’ on page 2
- Homepage has Paged Pages that should not exist, like /page/2/ and on to /page/99999/
- Randomised Post Time
- WordPress paginate_links() function doesn’t generate properly links after apply filters
- Not refreshing content pagination on search result
- rewrite url with parameter or pagination beyond certain value does not work
- stop pretty pagination rewrite site.com/cat/2 => site.com/cat?page=2
- How checked checkboxes remember on all pages in wp_list_table pagination?
- Update to 4.4.1 breaks my pagination
- Issue on single.php pagination WordPress
- Pagination on home page not working
- How to set up pagination [closed]
- WordPress triggers 404 on page 2 for custom search query
- Search page pagination does not work
- Custom wp_link_pages for paginated posts | Next page randomly
- Displaying the author of next and previous posts in pagination?
- How to ignore pagebreaks for RSS feed?
- Pagination For Table Rows on a page?
- Custom pagination code is not working
- The paging is very slow under a large number of articles
- Universal CPT archive template and half working pagination
- Custom admin page pagination permissions error
- Problem with older entries in homepage
- remove $_GET-parameter from WP_List_Table::tablenav
- WP Page Navi. 404 error when using posts per page parameter [duplicate]
- Pagination for previous page/next page (with more than one post/page)
- Pagination Adding Numbers in Strange Fashion
- Pagination for custom post types
- Pagination in author, category, archive and tags pages does not work
- WordPress pagination with wp_query_columns
- How can I paginate results from get_children
- Setting up Pagination with twentytwelve_content_nav
- Why can i add /page/674874 (or any number) to a URL and it still pulls up that page?
- How to add numbers pagination to this blog page?
- Show number of pagination pages even when total under two
- Why next_posts(); function does not work inside header.php?
- empty pages on pagination with meta query
- I would like to fix a problem with post pagination: i can only see the url title (prev – next) but title is truncated
- Override the WordPress default pagination markup
- Pagination with Metaboxes or Custom Fields
- Custom post pagination not working
- The pagination is working on Local, not on LIVE. why?
- 2 Columns with Independent Pagination
- Prevent WordPress to remove query vars from url
- Google Indexed sub pages in wordpress pagination in post
- Paginate Links function: Page 1 doesn’t work
- Pagination doesn’t work on static front page
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- Changing post per page causing 404 for pagination. Need a redirect htaccess rule
- How to display most viewed posts without any plugins
- Search engine not working
- Split a long form into multiple pages
- Pagination options using xml data instead of database?
- Infinite scroll repeats posts in custom loop in single.php
- One post on frontpage and an archive page
- pagination for blog landing page
- Pagination is not working correctly there is this wierd looping
- Pagination Error – Same Posts Displaying Over Again
- margins in between pagination links [closed]
- Page navigation not working correctly on index but only on categories
- How to split long posts in multiple pages in twentysixteen
- Duplicating pagination on second page
- Pagination not working on custom post type archive
- How to change `page` slug in pagination? on a specific pagination result (not globally)
- Two pagination in one page without being synchronous
- How to build custom pagination with center pages
- Change “/” (slash) before page number in pagination path to “-” (hyphen)