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 template not loading from plugin
- Create side bar widget showing list of years as hyperlinks for a custom post type
- How can I allow plugin users to define layouts for a custom post type
- Add block templates (html) via plugin for custom post type
- Pagination not working on custom query on a page
- Loop through posts of only 2 statuses
- sort CPT on Custom Taxonomy Archive page
- How to access the thank you page from the single post?
- How do I add custom HTML to the content of an archive page’s posts?
- Looping Through Categories of a CPT
- How do you make a list and list item relation if custom post types?
- Add to ‘action’ within post.php to allow more actions when editing a Custom Post Type in a plugin
- How to get_term_meta on single custom post?
- Search Filter CPT, Custom Loop
- ajax response not recieving
- Add form after woocommerce admin order edit
- ACF for custom post type archive pages: which hook to use?
- Custom Meta Box returns no HTML
- How do you output an unknown number of images in a custom post type with desired markup?
- Get data from PHP to JavaScript to set position of each post on front page
- Pull in taxonomy field of custom post type in new query
- Use the custom post type archive for taxonomies?
- Unable to format dates to put in event calendar
- How to add a lightbox to class mix?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- How do I find a way to create a global single.php for a custom post type?
- How do I assign a block template (.html) to a custom post type?
- How to add query args to links to CPT admin submenu
- Templates for hierarchical custom post type
- display posts of custom post type with custom taxonomy
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Query to get child pages of current page and display it in action hook
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Custom Post Type not showing in main loop
- My custom taxonomy is only displaying 1 of 3 terms
- Add more than one custom post type to wordpress home page post loop
- Custom Post type date archive for custom taxonomy
- get custom post type value in header.php [closed]
- Custom Post Type setup
- Show categories of custom post type and not all posts
- Apply template by path/slug related to custom post type?
- Dynamic assign a custom template to custom post type posts
- Get post content from another section in custom single page
- How to get the current category with custom posts
- Custom post type is using the index.php template
- Get post format
- Custom wordpress loop
- Custom Post type content within a slider
- Trying to add a class to post links
- CPT Archive pre_get_posts not working?
- posts within custom post type all share the same content in the front-end
- Custom Post Type and Taxonomy Loop Output Is Wrong
- displaying content of custom post type
- How to add and display custom content that is not a post