Site logo

[Resolved] Apply single.php from the “Explore” theme from the site library to a CPT

Home Forums Support [Resolved] Apply single.php from the “Explore” theme from the site library to a CPT

Home Forums Support Apply single.php from the “Explore” theme from the site library to a CPT

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2592476
    Rafael

    Hi there,

    I’m pretty new to customizing a theme. Even though I’ve built quite a few sites for personal experiments in the past, I usually just use the themes as they are, out-of-the box.So this is my first rodeo 🙂

    I just created a new site and (first mistake I made) I downloaded the “Explore” theme from the site library and didn’t create a child theme. I’ve just started working with it as is. I am now at a point where I like what I have, but no child theme.

    First question: I should have created a child theme first, right? Is there any way to do so now without losing my theme changes? I’ve mostly just been personalizing the frontpage, the menus, etc.

    Second question: I’ve created a custom post type, let’s call it “projects” to stay consistent with the documentation here. I want to apply the same layout, theme,etc to the CPT as the one seen for posts here. I followed the steps in the documentation, but I can’t make it work. I’ve tried adding this:
    get_template_part( ‘content’, ‘projects’ );
    and this
    generate_do_template_part( ‘projects’ );

    And I can’t get it to work. What am I missing?

    Thanks!

    #2592541
    Ying
    Staff
    Customer Support

    Hi there,

    1. If you are not going to edit PHP templates then you do NOT need a child theme.

    2. You do NOT need this code, as the Explore site template is using block element - content template for the single post, and the page hero is added using a block element - page hero, these are block-based template, there’s no specific PHP templates for single posts.

    You just need to find these 2 elements at appearance > elements, and add the single CPT to the 2 element’s display rule > location.

    #2597965
    Rafael

    Awesome, thank you @Ying! Marked as resolved.

    #2600337
    Ying
    Staff
    Customer Support

    Glad to hear that 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.