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
- Change permalinks for posts but not for custom post types
- Custom post type pagination 404 fix?
- Filtering a custom post type by custom taxonomy in archive template
- get term archive url / link
- How to get the custom post type from an archive page?
- How to remove “Archive:” label from archive title
- Assign single template to multiple custom post types?
- How to build a complex page structure
- Proper way of making custom post type landing page or archive page
- Display Editable Text Above CPT Archive Listings
- Custom Post Type Archives with 0 Posts Redirects as 404
- Archive page with multiple taxonomies rewrite
- Archive page…limiting posts per page
- WP 3.1 – archive pages for custom content types possible now without a plugin?
- How can I fix those issues generated by the Themecheck plugin
- Why is get_post_format() for “Standard” returns empty
- Date archives for custom post type
- Custom comment status possible?
- Password-protect a custom rss feed
- Rename a current used post type
- Template tags to display custom post type posts in category template?
- paginate function in archive for custom-post-type
- Call different archive page based on post type
- How to create archive page for taxonomy terms within custom post type
- adding .current* tags to custom post types and taxonomies
- Page as a child of a Custom Post Type
- Display CPT description on archive.php pages for all CPT
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- Custom Post Type Archive Page Filtering
- How to modify archive query with pre_get_posts to append CPTs?
- URL of a custom post type’s post format archive?
- Help need making decision. Ads rotating site on wordpress
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Change CPT archive title
- Display a grid of taxonomy terms at root taxonomy page
- The loop seems stuck to a single (now deleted) post
- Use “archive” as slug for custom post type
- How can I get this request to use the Custom Post Type page template instead?
- Warning: Invalid argument supplied for foreach() [closed]
- Custom post type isn’t working
- What’s the name of the custom post type yearly archive template?
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- Custom WP_Query doesn’t display all posts
- How can I use archive-{post_type}.php theme template?
- Taxonomy archive 404ing (not term archive)
- Two column layout with alphabetical ordering
- Custom taxonomy or custom page templates?
- Show Taxonomies with admin area for custom post type?
- Pagination doesnt work in custom post type
- Custom post type’s posts are not showing anywere but in xml sitemap
- Use the custom post type archive for taxonomies?
- How to constrain the results to a specific post_type on tag archive page?
- If Post type use sidebar (‘tree’)
- Having Issue on Getting Metabox Checkbox Value
- Custom meta box in custom post type not working
- How to Enable Ascending or Descending In WordPress Default Built-in Loop
- How to display posts from a certain category in a bootstrap 5 carousel loop with multiple items?
- How to get the custom post data using post id in WordPress?
- Loop all post on single.php
- Custom post type 404 category page
- programmatically generated custom post type is created more than once
- Custom Post type page content (archive page)
- Set up Custom Taxonomy Archive Template File To Cover 3 Categories
- How to use posts as tabs in a custom page?
- Group custom post type posts by month
- Custom WordPress theme not displaying posts from category
- Problem with multi checkboxes value in metabox?
- Custom post types not showing on the standard WordPress Category page
- Turning archive templates to a page template maintaining the slug
- Order archive custom posts by taxonomy term [duplicate]
- call a function when insert and update a custom post type
- How To Display Category list from Portfolio post type plugin?
- Custom Post Type tag taxonomy “Page Not Found”
- Search form to find custom meta box generated data
- Custom Post type archives / categories give 404
- How to Display CPT Posts on index Page
- Query custom post type and showing its content
- Issue on Counting CPT’s Under Taxonomy Term
- Archive.php is not displaying tags
- Custom post type category page not working
- Why is my custom form saving with ‘autodraft’ as title and slug?
- Custom post types with date based archive
- paging is not working properly on news archives page [duplicate]
- Categories in custom post types
- Apply custom names for generic custom taxonomy name?
- is_singular won’t call my functions?
- Category names on CPT archive pages [closed]
- How to turn custom-post archive into an overview page, listing the metadata of the posts?
- how to pass args for archive.php query?
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Remove plugin’s custom post type archive page and single pages [closed]
- How to create custom page templates with default page layout framework?
- Can you programme the selected page template to display block patterns automatically?
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query