You are not setting the $paged
parameter anywhere in that code. You need a line something like this:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
It really looks like you should be using a function hooked to pre_get-posts
as here and as in a lot of answer on the site.
Related Posts:
- How to remove custom post type archive
- How to use a custom post type archive as front page?
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- Create a custom archive page for a custom post type in a plugin
- Custom Post Type Settings page, choose page to display archive
- Adding a menu item for a Custom Post Archive
- Custom Post Type Archive Page not showing
- Adding custom post type archives to a WordPress menu
- How to set a custom post type to have viewable future posts
- Custom Post Type Template – Archive
- Page Template as Custom Post Type Archive
- Custom post type yearly/ monthly archive permalinks
- Remove current_page_parent nav class from blog index when in CPT
- Can’t get post id on page that is a custom post type archive
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- WordPress Custom Post Types with a page as a parent?
- How do you create an archive for a custom post type from a plugin?
- How to order adjacent posts (prev / next) by custom field value?
- How to model a hierarchy for courses, levels and lessons?
- Proper way of making custom post type landing page or archive page
- Custom Post Type Archives by Date with Custom Permalink
- How to List All Custom Post Types Names (Not Posts)
- Change title in head on Archive page
- How make get_next_post() return first post when viewing last one
- Custom Post Type Archives with 0 Posts Redirects as 404
- How to filter custom post type archive by meta value
- What are the advantages of using a custom post type archive?
- Page is defaulting to archive page and not designated template
- custom post type archive page url to point to Page permalink
- “Edit” option for custom post types archive page
- Custom Post Type archive as front page
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- Problem excluding category from get_next_post
- Get monthly archives for custom post type
- Is it possible to remove the posts_per_page limit on a specific post type?
- Add Settings to Custom Post Type
- Is it possible to have an index page for taxonomy term for each custom post type it is assigned to?
- Custom post type permalink structure with the category also acting as an archive
- How to get_queried_object on multiple objects?
- Custom Post Type Works but Still Shows “Page Not Found”
- Assign Page Template Within A Custom Post Type
- Custom Post Type / Taxonomy Slug / Post Title with post type archive
- Rewrite custom post type url’s adding meta box values
- I can’t set meta_key in my custom post type query
- Hide child term posts on parent term pages
- specify meta_key / meta_value condition for prev_post_link and next_post_link
- Posts per Page on custom Taxonomy Template
- Compare 3 custom fields and sort by oldest
- Post type archive page not working
- Adding Sticky functionality to Custom Post Type Archives
- paginate function in archive for custom-post-type
- Adding custom post types to archive.php
- Custom Post Type – Archive page title
- Alphabetical sorting of custom post type – one letter per page
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Nav menu of all posts in a custom post type
- Archive page for taxonomy of custom post type
- Add meta data to the custom post type ARCHIVES page
- Should I change these content meta types before building complex archive page?
- Full-Ajax Theme: parseJSON error while building a JSON object from a WordPress custom template
- posts_nav_link on single post template
- archive-{$post_type}.php not loading. instead the default archive.php loads
- Dropdown list of a custom post type
- Highlight nav menu terms
- Getting taxonomy terms used by custom post type
- Custom post type archive sorted and grouped by date in post meta field
- Archive or taxonomy pages not working for custom post type
- Custom Taxonomy Breadcrumb Navigation
- Create Custom Post Type Archive Page with Sub Categories Navigation Sidebar
- Custom Post Type archive giving 404
- How to create archive page for taxonomy terms within custom post type
- How to make an archive page displaying posts in a date range
- Categories and Tags not working!
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy
- Select menu should display categories and the item’s depth
- Custom query variable – get wordpress to redirect to nice permalink url
- Custom Post Type Archive Title Lowercase
- Navigation won’t update to show full path to single post
- Add a class to a menu item depending on a body class
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Pagination not working only on Archive-Name.php using new WP_Query
- Show custom post type on post category page doesn’t work / breaks navigation
- On archive.php show loop for child categories if they exist or posts if they don’t, on custom post type
- Pagination not working on custom post type archive
- get_the_post_navigation not working
- Best practice to display a list/archive of Custom Posts in a Page Template
- Archive pagination – second page shows exactly the same posts
- Custom archive URL as a subfolder of the custom post type slug
- Can’t add custom post type archive page to menu
- Dynamic WordPress rewrite rules for multiple custom post types
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query
- How to work with URLs where sometimes a post or a subcategory is in the same part of the URL structure
- Show only taxonomy types terms associated with a custom post type in WordPress PHP
- Create side bar widget showing list of years as hyperlinks for a custom post type
- Made a Custom Post Type using ACF. Via the dashboard I cannot see the view button to see the post
- Remove date rewrite rule for custom post type archive page
- Custom Post Type Pagination Showing 404 On archive pages
- Cannot create custom post types with a specific name
- Rewrite taxonomy permalink appended to CPT archive url