• Resolved rjnagle

    (@rjnagle)


    (I don’t have any reason to believe that this problem is related to 2023 theme, but let me know if you think it is).

    I was creating a new website using Full Site Editor (FSE) and the 2023 theme. I’m not a php or WP developer, but I have lots of experience managing several self-hosted wordpress sites and using FSE to create/customize templates and template parts.

    My goal is to create two separate layouts for posts (not pages). For all posts I will be adding a Featured Image to show up in social media and in archive pages.

    Layout 1 should have the Featured Image show up on top of the individual post.

    Layout 2 should not have the Featured Image show up on top. It will only show up on the Archive page and on social media.

    Doing that has proven to be fiendishly difficult when using only the FSE.

    In the FSE template editor under Templates, I select ADD NEW TEMPLATE –> SINGLE ITEM POST –> ADD NEW TEMPLATE. I have a choice between ALL POSTS and POST FOR A SINGLE ITEM.

    I don’t quite understand the exact meaning of both options, but when I’ve created new templates for SINGLE ITEM POST with either option, I can create the template and save it (naming it “CUSTOM-POST-WITH-FIMAGE”). I just can’t invoke the template when I create a new post.

    In contrast, I know how to create PAGE templates and invoke them. For example, I have created a new PAGE template (named CUSTOM-PAGE). When I create a new PAGE, on the right menu you can click on TEMPLATE: Page link (and then select CUSTOM-PAGE template which is listed in the dropdown list of templates). So that leads me to believe that I would do something similar when I am creating a post using the CUSTOM-POST-WITH-FIMAGE template. The only problem is: CUSTOM-POST-WITH-FIMAGE never appears in the template dropdown list when I am editing a new post. I only see the regular templates and custom template pages I have created (like CUSTOM-PAGE).

    From the right menu of the post edit screen I see that the default template type for new posts is TEMPLATE: SINGLE .

    What am I missing here? Why doesn’t my CUSTOM-POST-WITH-FIMAGE post template ever appear in the template dropdown list when trying to create a new individual post? Is this a bug with my theme? Or is this expected behavior?

    Finally, if this is expected behavior, what steps would be necessary to create an archive page listing both pages and posts mixed together? I see that in the QUERY LOOP block you can choose either POSTS or PAGES but not both. Is there an option to do this (or maybe a plugin)?

    Thanks.

    • This topic was modified 1 year, 5 months ago by rjnagle.
Viewing 2 replies - 1 through 2 (of 2 total)
  • I agree that the naming convention can be confusing… but the confusion is fairly consistent once you get the hang of it ??

    In the FSE template editor under Templates, I select ADD NEW TEMPLATE –> SINGLE ITEM POST –> ADD NEW TEMPLATE. I have a choice between ALL POSTS and POST FOR A SINGLE ITEM.

    It seems these options do exactly what their names say, and none of them do what you want.

    The ALL POSTS option does just that: it overrides the default SINGLE template and is automatically applied to ALL POSTS. Consequently, it’s not selectable on an individual post basis.

    The POST FOR A SINGLE ITEM also does just what the name says: a single item only. In fact, after choosing this option, the next screen asks you to select THE SINGLE ITEM (screenshot below) that should use this template. As such, this is also not selectable when making a new post. (I’m not sold on the usefulness of this, but it is what it is.)

    In your case, you’ll need to select the CUSTOM TEMPLATE. This custom template can be applied to –any– POST or PAGE and can be selected in the post/page editor.

    Thread Starter rjnagle

    (@rjnagle)

    George Appiah, thanks. You are a life-saver. (sorry for the delay in replying).

    I can’t believe it was this easy. I spent a couple hours trying to figure this out, and I knew I had to be missing something obvious.

    Once again, thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I create 2 different layouts for posts in FSE?’ is closed to new replies.