You shouldn’t be using new WP_Query()
in archive-product.php
(or any archive template). The right posts have already been queried, and this is what the pagination is based on. You just need to loop through the right posts with the standard loop. Look at the default archive template in WooCommerce:
while ( have_posts() ) {
the_post();
// etc.
}
}
Notice that there’s no $the_query
or anything like that.
Related Posts:
- Custom post type loops with different page templates
- How do you output custom code between posts in the loop?
- Loop increase number
- wp_pagenavi() with custom wp_query()?
- Custom post status not working
- Custom Post Type Pagination Not Working On Archive Page
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- Archive page…limiting posts per page
- Date archives for custom post type
- How can I add dropdown widget/box to admin post page?
- Pagination go to first page if i’m on last post
- Posts in Multiple Columns and Rows with one single loop
- Best way to style first post differently?
- Append taxonomy terms as class names in markup?
- How to append element after thumbnail
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Display custom field of specific post where post title matches variable
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- How would I create a shortcode to display a custom post within a page or regular post?
- GravityForm: Populate Dropdown with custom post type [closed]
- Pagination for custom php code
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- What’s the difference between same wp functions get_posts(); functions in different form?
- Custom Post Type Loop throws 500 error when used in widget
- Page vs Custom Post Types Differences/Issues
- Can I list a custom post type within another custom post type in the admin area?
- I would like to have different styles for my posts based on the content of each post
- Checking if Post Title is Unique as Loop Criteria
- Paging doesn’t work?
- Set URL link to featured image of custom post type
- Custom Tag Description unable to display just below and outside of the Loop
- AJAX load more for different custom post type loops
- On update or create post redirect to current post position in list
- I need to add endpoint for wordpress categories
- Hide a widget inside a div on specific type of post
- Custom Theme With Custom Loops
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Custom Post Types strange pagination problem
- categories should be available across all custom post types
- Cant get paginations on single.php to work with my custom post types
- Including all post id’s of a custom post type into an array
- How can I group posts by months and years?
- PHP question: how to combine syntax?
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Custom Pagination is Broken
- custom post for slider
- Using wp_query to modify the loop in index.php for a CPT
- How exclude or skip post type with get_next_post_link
- Create short URL with auto 301 redirect
- Is it possible to use array_walk() to append terms to an array of posts?
- Custom post type and custom taxonomy 404 on page 2
- Show current user posts in custom post type query
- Get post format
- post_content is stripping HTML when adding a new post? [closed]
- Template code to split a post and print a custom field?
- Foreach loop returning more than one item when querying taxonomy
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Post type Echo code is repeating on homepage
- How can I increase the post count for custom post types only?
- Custom post type pagination error
- Show the categories the current post has
- Fetch data from two custom post types and create multidimensional array for output to html table
- Page that lists publications by classifying them by taxonomy
- Custom archive page for custom taxonomy and pagination issue
- php dynamic content inside shortcode
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- Check that a slug is present in the get_terms request
- Custom post type paging return home page
- How to add specific terms in a custom post type?
- Assigning categories to custom post types via a front-end form; only works for native post type
- when looping through custom post data not appearing
- Limit custom post type to the authors only on front-end!
- Accessing download link from the loop with WP Download Manager Pro
- Custom Post Type has wrong label and is not found when called by a loop
- Create posts inside CPT post
- ACF field check value of field on all other articles
- Combine multiple separate lists into one
- Why is my loop not populating the page with my custom taxonomy terms from my custom post type?
- Show parent category and subcategory once in while loop
- WordPress trying to query two custom types to get child from the parent
- next_posts_link() always generates second page link on custom post type
- Display related post content and custom field content
- 2 custom posts types, in their own columns, one pagination for both
- WordPress loop add heading before first of type
- Featured image in custom post is being disabled
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- can’t see categories in appearance-menu-categories
- How to Fix Custom WordPress Loop with Pagination on Single Post View?
- Pagination on custom post types
- Pagination in custom post type page template
- Custom post type archive pagination with HTML5Blank theme?
- Posts without featured image using other post’s featured image
- Order by custom field attribute
- Pagination not working with custom loop
- Code in custom widget queries all posts, when it should only query the current post
- Comments are not working on Custom Post Type
- WPNavi pagination links not working on custom pages
- how to display custom taxonomies in front page
- How do loop categories post from according in WordPress? is it impossible to solve this problem?
- Where paramaters of a custom function are coming from inside the loop?