I think you need the get_post_type_archive_link
function. It requires a post type as a parameter, but since you’re already on the archive page you should be able to use it in combination with get_post_type
, which gets the current post type by default:
$permalink = get_post_type_archive_link( get_post_type() );
See more on the Codex.
Related Posts:
- Main query not querying any posts in custom taxonomy template
- How to add custom content template part for a custom post type on main query using a plugin
- How do you create an archive for a custom post type from a plugin?
- Loading custom page template via plugin
- How to set a fall back template for a custom post type in a plugin?
- Page is defaulting to archive page and not designated template
- How to query custom posts using a dynamic category
- Posts in Multiple Columns and Rows with one single loop
- Alphabetical sorting of custom post type – one letter per page
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Custom post type loops with different page templates
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- How to append element after thumbnail
- How to list custom post types?
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- WP_Query | ‘post_type’ doesn’t work
- Set up Custom-Post-Type Author Archive
- Create template for taxonomy results limited by Custom Post Type
- Getting template_include to work when allow_url_include is off?
- WordPress post_where & posts_join not working only for custom post type
- Custom post type archive page blank
- Custom Empty Results page for my Custom Post Type
- How can I use archive-{post_type}.php theme template?
- Dynamically insert code to custom post type loop
- assign different templates to custom post type with homepage loop
- Assign a template to a custom post type when displayed by the main loop on the home page
- Create a custom taxonomy template that loops through child categories in term order?
- CPT archive page – show one post from each taxonomy term
- Specifying a template for custom post type pages
- On click some element i want to use some template
- Accessing download link from the loop with WP Download Manager Pro
- Warning , Use of undefined constant PLUGIN_PATH?
- % encoded URL giving 404 error in WordPress
- Custom taxonomy template for custom fields loop [closed]
- How can I load Template file from wordpress plugin
- Custom post types not displaying per category
- Error in WP Query. If variable is empty it is displaying previous post value
- Custom post type with two templates
- Display custom post type archive on page.php template
- Show Templates in Custom Post Type Editor
- How to avoid hardcoded text in a custom page template?
- Load different template for CPT (in loop) in my plugin?
- How can I pull information from my loop and divide them seperately?
- How to create custom page templates with default page layout framework?
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Best practice to display a list/archive of Custom Posts in a Page Template
- Custom post type yearly/ monthly archive permalinks
- Taxonomy, Terms, and Template Files
- How to control output of custom post type without modifying theme?
- Using Templates with Custom Post Type UI
- Custom Post Type archive giving 404
- Query Custom Post by Category
- ‘category__and’ for custom taxonomy?
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Create second custom 404 page for selected post type
- How could I create a ‘private comments’ section on a custom post type?
- Custom Post Type with has_archive ignores my custom archive and single template
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- Checking if Post Title is Unique as Loop Criteria
- Custom post type multiple loop by taxonomy term
- Can I override a CPT template on a per post basis with Gutenberg block editor?
- Custom post type, organized by categories
- A custom post within a custom post
- get_the_title() is returning results from previous loop
- 3 random images from custom post type, each in a div with a diffrent class
- make permalink go to a custom single.php file
- Displaying multiple post types on home page
- Shortcode leaves no space for other elements?
- Query Posts that have Custom Taxonomy
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Permalinks for single-[custom-post-types] not working
- Most viewed post of custom post type
- Order Custom Post Type Archive by multiple values in functions.php
- Require custom post type if is_admin() – template doesn’t show up?
- Shortcode in pages or tempate files for custom post type
- Custom post type page with parameter
- How can I loop at a Specific Taxonomy from a custom post type?
- How to show the post which checkbox is not selected
- Replace Content of Sidebar on Custom Post Type
- WordPress next post by ajax call on button click
- pagination problem listing custom post types of taxonomy in wordpress
- Pagination for a cpt filtered with a category
- How do I force a CPT to select a shared custom template in Post Attributes?
- How to Use A Custom Post Type as Taxonomy for Another Custom Post Type
- Sort loop by custom field from different post type
- Meta_query by date for Events archive
- Show posts for current taxonomy
- Include template if a post is a single product
- WordPress loop, show only one post per custom field
- Render custom taxonomy query as single template
- Templates list in “Page Attributes” metabox is inaccurate
- Loop multiple taxonomy in custom post
- $post breaking container loop
- Stop Custom post type from being searched via URL
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Pagination not working for archive
- why get_post_meta is returning 0?
- How to create an upload page (front side)
- Get all active posts that are tied to a custom taxonomy for a custom post type
- WordPress post objects in one parent post object