For anyone still struggling with this, here’s a solution:
$args = array(
'post_type' => 'your_custom_post_type',
'post_status' => 'publish'
);
$query = new WP_Query($args);
?>
Then output it anywhere in your template like so: //Output
<?php wp_get_archives($args); ?>
Related Posts:
- Custom Post Type Archive URL takes over page URL
- Custom post type archive sorted and grouped by date in post meta field
- Archieve.php not loading for custom post type
- Why does my URL keep returning 404 error code?
- How can I tell if I’m on a custom post type archive page?
- Custom Post Type archive page listing a 404 or single post
- Return the latest post from a custom Taxonomy and Post Type
- Don’t know how to show custom taxonomies from a custom post_type
- How to get post type and month/year before while loop for date.php file
- Not Able to Get Custom Post Type Gallery Images URL
- JS innerhtml changing style when using AJAX
- Why is my site using index.php instead of archive?
- Display a grid of taxonomy terms at root taxonomy page
- WordPress showing archive.php instead page
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- How to change the post type a theme shows by default?
- Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
- Custom post type archive page blank
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Event Custom Post Type Title show by upcoming Event Dates
- How to have this permalink structure: post_type/postname/custom_inner_page
- Custom archive page for CPT UI
- How to display custom post in archive section of the wordpress page?
- Building a Treatments Page, What Do I Use?
- The loop seems stuck to a single (now deleted) post
- Use “archive” as slug for custom post type
- Custom post type / taxonomy rewrite archive page 2 gives 404
- Archive for CPT
- Is it better to use filter for the_content in archive pages?
- Custom post types and category archive
- custom comments form for custom post type
- How to produce a sub-page-system in WordPress
- How can I get this request to use the Custom Post Type page template instead?
- WebP Fallback for Inline Background Image in Style Attribute
- Custom post type posts don’t show in archive widget
- How to specify a template for a path like http://example.com/something?
- Archive for a Taxonomy of a Custom Post type
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- Warning: Invalid argument supplied for foreach() in post.php [closed]
- Archive not sorting correctly
- Problems with 404, .htaccess, permalinks and WordPress custom posts locally on Snow Leopard
- How can i link a custom post type thumbnail to intermediate size
- What’s the name of the custom post type yearly archive template?
- i cant see the max_num_pages of a custom wp query
- how to remove pages loading with the archive templates
- multiple custom post type on category page
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- Custom Post type & Taxonomy 404
- detect your custom post type in WordPress
- Display custom post using ID
- Custom WP_Query doesn’t display all posts
- How can I use archive-{post_type}.php theme template?
- Specify a particular page to list all custom types
- WordPress app page not found error for posts with hyphen in permalink
- Where is the sticky post option?
- Taxonomy archive 404ing (not term archive)
- Return the name of the post type
- Two column layout with alphabetical ordering
- Assign CPT archive page attributes
- Set a hard-coded page-template (post-type-archive) as home/front-page of my wordpress blog?
- Create a comments template for custom post types
- Custom post type permalink sends to 404.php
- Custom taxonomy or custom page templates?
- WP_Query with custom post type ID
- Dynamically insert an article at the top of a taxonomy archive – or?
- Archiving custom post content?
- archive as a page, so that it can be added in the wp_menu_nav
- Can anyone clarify difference between archive-{posttype}.php, type-{posttype} and date.php?
- Api rest_route 404 while building filter for custom posts (filtered by multiple meta keys / custom fields)
- how to get this tax_query working?
- How do I add custom HTML to the content of an archive page’s posts?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- Show Taxonomies with admin area for custom post type?
- Pagination doesnt work in custom post type
- Show All Custom Post Types On A Single Archive Page
- Include custom post type custom taxonomies in Categories widget
- Template Hierarchy for custom post type pages
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- Custom post type’s posts are not showing anywere but in xml sitemap
- Use the custom post type archive for taxonomies?
- How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Custom Post Type setup
- Archive Page for Multiple Custom Post Types
- Can’t access private custom posttype single- or archives-page
- Display Date & Author Info on Custom Post Type Archive Page
- Assign a template to a custom post type when displayed by the main loop on the home page
- Custom Post type content within a slider
- How to constrain the results to a specific post_type on tag archive page?
- If Post type use sidebar (‘tree’)
- Methods for development wordpress themes [closed]
- Get the link of the first post of a custom taxonomy in a custom taxonomy list
- Custom Post Type – after disable ‘Add New’, I can’t edit and delete post
- How can I relate custom post types?
- Dynamic category name in query post
- Having Issue on Getting Metabox Checkbox Value
- Custom Post Type Archive Pagination
- Searching post types
- Custom meta box in custom post type not working