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
- Pagination not working with custom loop
- Have different number of posts on first page
- Display a query with multiple post types and same relationship on a single page
- 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
- Newer/Older posts links display same posts on every page
- Best way to style first post differently?
- List events by month
- Fix custom query pagination without changing site-wide posts-per-page settings
- Limit Authors to their Own Posts on front-end excluding admins
- Pagination with custom post types results in 404 issues
- 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?
- Output custom post shortcode. Help spot the error.
- GravityForm: Populate Dropdown with custom post type [closed]
- Create a random unique 6 digit number as custom field for custom post type
- Loading all files within a directory
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- A good strategy to print custom posts (offer) that are checked inside the metabox of a post?
- Very Slow Page – How to Optimize # of Queries?
- 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
- How to make sure content doesn’t display if selection is empty
- Page vs Custom Post Types Differences/Issues
- How to display all posts from standard posts to custom post types in a loop with pagination?
- How to customize a permalink (URL) structure?
- CPT + CMB2: data not displaying for only first post in loop
- Can I list a custom post type within another custom post type in the admin area?
- How do i calculate the total of values of custom fields in custom post types?
- 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
- get_post_meta not working on publishing
- Redirect 404 page with ID in slug to associated page with same ID in slug
- WordPress wrapped added a span tag to every single p tag
- ACF field key/value to show on taxonomy list
- Best way to style first post differently?
- Hide a widget inside a div on specific type of post
- Shortcode not working with post counter
- Stored meta from attachment, video length?
- WordPress trying to query two custom types to get child from the parent
- Add active class to foundation 6 tabs while looping categories
- Duplicate posts in my custom loop
- 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
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- WordPress query posts by custom post type not workng
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Featured image in custom post is being disabled
- Pods pagination erases my sub menu
- 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
- Pagination fault in custom post type archive page [duplicate]
- Custom post type archive pagination with HTML5Blank theme?
- Function not pulling image or text from custom post type
- WordPress Custom Post Type and sort by Tags
- Posts without featured image using other post’s featured image
- Order by custom field attribute
- Pagination not working with custom loop
- Pagination not working with custom loop
- Pagination not working with custom loop
- Pagination not working with custom loop
- Looping taxonomy in taxonomy?
- Pagination not working with custom loop
- Pagination not working on homepage
- Custom Loop for custom post type. Compare by meta_value?
- Query Custom Post Type by Tag
- Fourth page of custom post type archive page does not exist
- Code in custom widget queries all posts, when it should only query the current post
- Add HTML before a specific div?
- How do I filter a custom post type loop by a field?
- How to string lines from the_content() hook in WordPress?