When you register the custom post type you need to include has_archive
set to the slug where you want the archive. You also need rewrite
set to the slug prefix. It’s probably easier to understand the code rather than my wording of it:
Your code should look something like this now:
register_post_type('conference',
...
'public' => true,
);
You need to update it to:
register_post_type('conference',
...
'public' => true,
'has_archive' => 'conference',
'rewrite' => array('slug' => 'conference'),
);
You may need to use unregister_post_type
first, to clear it out, and then re-register with your updated function. After the new version is registered, visit your permalinks page to update permalinks, and you should then have both an archive at myurl.co/conference and individual posts at urls like myurl.co/conference/program-item-slug.
Related Posts:
- Hook for post and page load
- How can I add dropdown widget/box to admin post page?
- Custom Posts on Different Pages
- Include images from pages in wp search.php results in default wp search
- Display “Post 2 of 4” on single post page?
- Limit Authors to their Own Posts on front-end excluding admins
- Making pages also serve as taxonomies? Or give full pages to taxonomies?
- I am having a problem with form updating/editing WordPress post on the frontend
- WP_Query is printing out only one post when posts_per_page is set to multiple
- Trying to edit the single page from a Custom Post
- Blog page showing same content as homepage
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- Page vs Custom Post Types Differences/Issues
- If post has custom field then display css-class
- I would like to have different styles for my posts based on the content of each post
- Allow non-logged in users to see a future post after clicking on a list of future posts
- No Permission to add new Page, Post or CPT with Admin role
- Including link to custom post type in ‘wp_list_pages’ function
- Multiple pages per post (not pagination)
- Can I change my post type to anything and my site still work?
- Display an authors post on a single page only when they are logged in
- How to add new post using a form to categories when categories are using as menu
- Different post title, keywords and description
- Render a Post or Page using the correct file
- Template code to split a post and print a custom field?
- Am I mixing up the concept of posts pages and categories?
- How to setup different permlalinks for posts and pages?
- Sets post_parent in custom post type posts automatically based on cpt->page name
- Does “Custom Post Type” can have page hierarhy option?
- redirect after submiting post for review
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Is it possible to get the specific content on the search page?
- Why is my custom post content only viewable when signed into WordPress?
- How to change Elementor Template for Single Page Post on Load
- open custom post type in popup window instead of page
- WordPress – display relationship between blog posts and custom posts
- How to use posts as tabs in a custom page?
- wp_post_delete is deleting all offices
- Do not show child pages within a file page
- Disable Sidebar on certain pages
- Cannot save pages after migration
- News post with multiple permalinks? When opened from different page
- Custom Post By Category
- How to get the posts that my following users are liked?
- Include images from pages in wp search.php results in default wp search
- WordPress Contents Migration
- One Post with different content, depending on a Page
- Featured image in custom post is being disabled
- Why isn’t my custom post type using the corresponding custom post template?
- Cannot use pages created on WP
- Different post types arranged on one page
- How to display data with pagaination on backend?
- How to Associate Posts with Pages
- Why are my wp urls showing page not found?
- How to hide home title on pages and posts?
- How do I hide single category post on my post page
- How do I create an archive page for standard posts?
- How to use custom fields to enable sticky posts on custom post types?
- Update content of multiple pages/posts at once?
- Multiple portfolios with one custom post type?
- Is it possible to use pages to apply static content to each taxonomy level?
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- WP_Query search posts by custom post type and custom taxonomy
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- get_queried_object error How to show post count by month in the taxonomy page
- Check Title Unique Or Not and If not error message and dont save
- Share parent path between Custom Post Types and Pages?
- Dynamic Custom Post Type Plugin
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- How to filter out post type meta?
- ‘Pages’ widget alternative for custom post types?
- How to make in WordPress admin panel sortable column for the custom field, that count the number of page impressions?
- How to filter the taxonomy terms based on another taxonomy term
- Remove parent from custom post type
- CPT’s archive and single page not working [closed]
- Custom Blog Post Listing in Genesis Sample Child Theme
- Display custom field of specific post where post title matches variable
- Conditional to modify query results
- How to create A-Z index listing for custom post types?
- How to make post sticky in the admin page?
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- Check if admin is editing page or custom post type
- get_template_part for custom post type content not working
- remove child post from custom post type archive
- Pull in custom content types into page template
- Remove All, Published and Trashed Post Views in Custom Post Type
- Output custom post shortcode. Help spot the error.
- Loop on front-page.php
- How to count custom post types with conditional operators
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Why my custom post posts aren’t showing (404 error / page not found)
- Automaticly add slug to posts
- How to post twitter like updates on wordpress
- custom posts on different page
- Show Two custom Post type and their posts on category page
- WP Query to displaying date and posts for that date?
- GravityForm: Populate Dropdown with custom post type [closed]
- Return array of categories to php function for current post
- Link users to a custom post type
- How to Submit Post Via cURL & PHP