You need to set your paged arg in your $args array:
$listing_args = array(
'post_type' => 'business',
'posts_per_page' => 10,
'meta_key' => 'listing_num',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'offset' => ($paged -1) * 10,
'paged' => $paged, // <- tell the query what page we are on.
'tax_query' => ......etc
);
And then use the pageinate_links function, https://codex.wordpress.org/Function_Reference/paginate_links to populate the links to the next/prev pages.
Example from the codex on how to use it with a custom query:
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $the_query->max_num_pages
) );
Related Posts:
- Custom post type archive 404’s with paginate_links
- Number of pages – multiple (custom) post types
- Custom permalink with pagination
- Related posts by author pagination not working on the production site
- Secondary loop pagination on custom post type single post gets redirected to first page
- Pagination Doesn’t Work
- Numeric pagination custom post type
- Custom wp_query pagination – next_posts_link() or wp_pagenavi() always empty
- custom post type paging not working past page 3
- WP_Query pagination using only numbers instead of /page/1 on URL
- Pagination not working
- Pagination Issue: Custom Post Type In Index
- Custom query form submission pagination
- Paginated Taxonomy Term Archive including one post per term
- Unable to get paginate_links working with a custom query [duplicate]
- Pagination on category page with custom post types
- How to add pagination to wp_query [duplicate]
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Pagination on a custom post type loop
- Previous/Next Link by Meta Value in CPT
- Pagination for Custom Taxonomy Page [duplicate]
- Pagination on with query_posts in custom post type template
- Custom taxonomy rewrite give pagination 404
- Woocommerce search pagination not working
- How do you paginate a query grouped by month?
- Pagination issue on category.php using custom post type query
- Pagination with custom query, custom search form, single and pages, ajax and no plugins
- can these 3 queries be re-written as 1 query?
- pagination not working for category.php (custom post types in categories)
- Custom WP_Query always respond with 200 status even when no entry
- Pagination doesn’t function properly for archive of a custom post type set as the front page
- Trouble with pagination
- Pagination 404 on Index with custom query
- Custom post type and custom taxonomy 404 on page 2
- Custom Post Type Archive Pagination
- All blog posts are not showing up
- Single parent post lists child posts with pagination
- Custom post type pagination error
- Previous / Next Links For Custom Post Type Sorted By Meta_Value
- custom taxonomy pagination 404 error
- Pagination in custom post type archive.php not working
- Pagination Not Working When Used With WP_Query() `offset` Property
- Numeric pagination custom post type
- Problems in paginate_links with custom query loop and MB-Relationships
- WordPress doesn’t respect Page slug in custom post type url pagination. Keeps getting removed
- Make pagination work as a carousel (custom query)
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- why custom post archive gives always no more than 10 posts despite of paging settings?
- query and paginate multiple post types
- Custom post type blog pagination conflict
- Custom post type pagination, single page issue
- Pagination always adding “Next” link when results come from Custom Post Type WP_query
- Paged within a custom content type template [duplicate]
- Pagination not working on homepage
- send user to first page of results when reposting to page?
- Fourth page of custom post type archive page does not exist
- Pagination broke after updateto WordPress 3.4 [duplicate]
- Archive page – problem with pagination
- Query Multiple Post Types and Paginate Newly Created List
- “Page not found” while on page 2 from pagination menu
- Query by post title
- Get post with multiple meta keys and value
- Get posts for custom post type with WP_Query
- Get latest 4 post on a custom post filtered by category
- Display “Post 2 of 4” on single post page?
- wp_query and comment_parent – select only posts with top level comments
- Comparing timestamps in meta query doesn’t work
- Include both default and Custom Post Type in query modified inside pre_get_posts
- List all custom post type posts from a given category?
- Querying Term Posts in Loop
- Can’t get order_by meta_value_num to work properly
- orderby in custom WP Query does not work
- Unable to retrieve any posts of CPT in wp-admin
- Custom post type (with parent-child relationship) singular page with pagination
- Creating a navigation menu of all posts of a custom post type and their children posts?
- Including metaboxes from custom post types in global search — continued
- Can I display custom post types in home.php or need page template?
- Sort posts in loop by the WooCommerce Membership of the author
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- How to query for posts (hierarchical custom post type) that have children but are NOT top level?
- Create a WP_Query where if the first value of the first row is equal to the second compare other value
- Getting titles from an array of IDs
- Custom Post Type, Pagination and 404s?
- date_query empty results with custom post type
- display post count in archive page that have relation with another taxonomy term
- How can I sort the results of a REST API response by the title of a connected custom post type?
- Use WP_query to match post types based on custom field values
- How to get a custom post type archive paged when using a custom field for post sorting?
- Query events post type after current date and timezone
- Get posts of an specific term of a custom taxonomy
- Retrieve custom post by a query on one of its custom fields
- Conditional posts in WP_query for search
- This wp_query will not return any posts and only seems to work with post_status inherit?
- How can I pull information from my loop and divide them seperately?
- Cannot exclude particular post from loop of custom post type
- Unable to display paging navigation with a custom post type loop
- How to insert a post from a different post type after every nth post
- Sort CPT by taxonomy AND THEN by custom field
- Complex Custom Loop with Includes
- Instead of returning post content, return code that I specify