So below I will explain what all I'm doing and what I'm trying to achieve with this project:
I am using the Genesis Framework so the structure that I'm going with is the following:
- Themes
--- Genesis Framework
--- Modern Theme (Child Theme)
Steps that I've completed:
Created custom post type:
function profile_post_type()
{
$labels = array(
'name' => __('Profiles'),
'singular_name' => __('Profile'),
'add_new' => _x('Add Profile', 'Profile'),
'edit_item' => __('Edit Profile'),
);
$args = array(
'labels' => $labels,
'menu_icon' => 'dashicons-universal-access',
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'profile'),
'supports' => array('title', 'editor', 'thumbnail'),
);
register_post_type('profile', $args);
}
add_action('init', 'profile_post_type');
Within the custom post type, I have a Title, Bio box & Thumbnail
which is all that I need for now.
Here is what I'm stuck on.. So I'd like to use that custom post type that when I go to the page, they are presented with the default blog template (But a custom one that I can adjust).
So I've tried adding single.php in the child theme (Not sure that's even right)
When I go to /profile/{created profile} it leads to a Page not found
redirect.
Am I just not correctly linking the custom post type to a template on Genesis? I'd like to mimic the /author/ template as shown here: /
So below I will explain what all I'm doing and what I'm trying to achieve with this project:
I am using the Genesis Framework so the structure that I'm going with is the following:
- Themes
--- Genesis Framework
--- Modern Theme (Child Theme)
Steps that I've completed:
Created custom post type:
function profile_post_type()
{
$labels = array(
'name' => __('Profiles'),
'singular_name' => __('Profile'),
'add_new' => _x('Add Profile', 'Profile'),
'edit_item' => __('Edit Profile'),
);
$args = array(
'labels' => $labels,
'menu_icon' => 'dashicons-universal-access',
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'profile'),
'supports' => array('title', 'editor', 'thumbnail'),
);
register_post_type('profile', $args);
}
add_action('init', 'profile_post_type');
Within the custom post type, I have a Title, Bio box & Thumbnail
which is all that I need for now.
Here is what I'm stuck on.. So I'd like to use that custom post type that when I go to the page, they are presented with the default blog template (But a custom one that I can adjust).
So I've tried adding single.php in the child theme (Not sure that's even right)
When I go to /profile/{created profile} it leads to a Page not found
redirect.
Am I just not correctly linking the custom post type to a template on Genesis? I'd like to mimic the /author/ template as shown here: https://demo.studiopress/modern-studio/author/chrissy/
Share Improve this question asked Jan 20, 2020 at 20:27 user155484user1554841 Answer
Reset to default 0In WP Admin go to Settings -> Permalinks and Save Changes. You don't need to change anything, just save. This resets wordpress rewrite rules which usually fixes 404 errors with newly added CPTs.