0

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.

enter image description here

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) enter image description here

When I go to /profile/{created profile} it leads to a Page not found redirect. enter image description here

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.com/modern-studio/author/chrissy/

1 Answer 1

0

In 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.

1
  • You sir are a legend - Worked perfectly, didn't think it was that simple.
    – user155484
    Jan 20, 2020 at 21:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy