You can pass a string for has_archive
. That string will be used as archive URL.
So in your registration code use:
'has_archive' => 'jobs'
From the register_post_type()
declaration in WordPress core:
if ( $args->has_archive ) {
$archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;
if ( $args->rewrite['with_front'] )
$archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;
else
$archive_slug = $wp_rewrite->root . $archive_slug;
As you can see, has_archive
is tested for a string. If it is a string, that string will be used. If it is TRUE
the slug will be used. The string wins.
Related Posts:
- Use one template only for custom post type archives?
- Custom Archive with Content for Custom Post Type
- How to change the default registration email ? (plugin and/or non-plugin)
- How can i change email template for new user
- Enable page templates. How?
- Is it possible to override the result of get_template_part()?
- Prevent comments_template() to load comments.php
- Page editor missing Templates drop down
- Custom templates folder
- How to Rename a Template File?
- get page templates
- Load entire NextGEN gallery from single thumbnail?
- stop blog page from using index.php?
- How to assign a class to a page with a custom template?
- Proper Javascript Implementation
- Guest author’s post not display in author template
- Change site template from php
- How to apply a custom template for posts by default?
- Display HTML only if Custom Field has a Value
- how to create template path for external (include) .js file
- How to Increment ID value within ACF Repeater Field Loop
- Is there a way to check which template file is being loaded, if it is not a page template file?
- How to remove wp_link_pages() from template
- How can I get WP to use templates in lower-level subfolder?
- how to make a home page for wordpress custom theme
- home.php not loading
- Generate Catalog Of Posts Based On Template
- Extending body classes in front- and backend
- How to get the most recent modified date of anything in the footer of my site?
- How do I find the directory of a page template?
- Is there a way to set different post templates for parent posts and child posts in the same post type?
- Why write markup for index.php?
- How to remove the Template drop down, but keep Parent and Order
- Search results when none found – stay on page they were on
- Having trouble with Template hierarchy. I Need to create a set of pages that drill down from states to specific locations
- How can I hardcode template selection?
- Changing layout programmatically
- How to identify which template WordPress’s default search-form retrieves in my theme
- How to use same page template if post status other than ‘publish’?
- Possible to have one template call different sidebars for different pages?
- Best practice to update the file header.php
- page-{slug}.php vs. template-{slug}.php
- Understanding the Template hierarchy
- How does WordPress choose archive type template?
- How to properly Remove certain CSS / JS files from template
- What is the most efficient way to create multiple versions of the same template?
- Are there any downsides to not using get_header(), get_sidebar and get_footer()?
- wp_enqueue_style and different styles for blog template
- Can I have both front-page.php and index.php?
- How do I get the page template name chosen?
- How can I add text to a specific ‘Edit Page’?
- Automatically use specific template to load subpages
- how can I add a “read more” tag directly in the template?
- No three-columns template in TwentyEleven?
- Can’t split the_title() by white space
- Not so common HTML transition to wordpress issue
- Differentiation between index.php and page.php
- Undefined get_header function
- Single-page.php template file name not shown
- WordPress custom template not showing in the list of available templates
- How to create new template page and template-parts in wordpress theme [closed]
- Assign Specific Template for Custom Post slug
- How to display custom post type?
- Pagination issue with tag.php
- How are the HTML classes generated?
- Page Template with Sidebar Naming Convention?
- Adding text to the footer of each post based on tags or categories
- Blog page won’t show Blog template
- How can I abstract code out of a template by using functions.php
- Make Permalink go to specific template
- WordPress function.php on ZendFramework CMS
- Site Title appearing twice on live site
- Give user option to select full post index page or excerpted index?
- the_post() in RSS feed
- how to change already posted blog to custom template wordpress?
- WordPress change title with custom dynamic
- template with multiple post loops for multiple widgets [duplicate]
- Random home page at each refresh between array of page IDs
- Do not trigger page 404 on custom template
- Print different parts of content in template
- How can I pass a variable from a template to header.php of a theme
- Page Template Selector Error
- Overriding the template files using a plugin for all themes
- Change Page Template Based on URL Rewrite in WordPress
- I want to display all related posts for a selected tag in WordPress
- How can I modify this code to include the parent?
- WordPress Child Theme Template auth_redirect wrapper
- Show a custom template, no matter the page being viewed, if the user is not logged in
- Is this the best way to complete disable category archive pages?
- printf, translation and the_author_posts_link()
- Tag Posts showing in wrong places
- Problem with custom page template and permalink
- Index template and Home page
- Force template on page load
- front page won’t change templates
- Including 2 Negative Is_Template Conditionals in header.php [closed]
- Add custom card template to masonry layout using Essential Grid [closed]
- Where is the general html template file?
- templates page not showing on gutenberg editor
- How to load php templates from html page (block theme)