• Resolved Lars-Christian

    (@larscsim)


    Hi,

    I’ve got a custom post type “Notes” (created by the great IndieBlocks plugin). For posts of this type, I’ve got two different categories. My aim is to create separate single post templates for these two categories.

    According to the documentation:

    Category – It allows the creation of templates that can be applied to posts by a specific category on the site or as the default template for all categories (if not already defined by the theme).

    But all I’m seeing related to categories when creating a new template, is “category archives”. What gives? Currently, the default template for these single posts follows the post type. Is it not possible to define a category single post template if a post type template has been defined?

    Using the TwentyTwentyFour theme.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator James Huff

    (@macmanx)

    I recommend asking at https://www.ads-software.com/support/theme/twentytwentyfour/ so the theme’s designers and support community can help you with this.

    Thread Starter Lars-Christian

    (@larscsim)

    Thanks for the response James.

    Maybe I’ll have more luck there. But is this really a theme specific issue? Far as I can tell, this is related to the site editor rather than a specific theme.

    Moderator bcworkz

    (@bcworkz)

    The only way to affect single post appearance and layout by “category” is with post formats and not specifically by the category taxonomy’s terms. Post formats is a feature that themes would need to opt into. Formats are limited in scope, you cannot create your own. Few themes opt in.

    It is also feasible for a theme’s template to conditionally output one thing or another based on assigned category of a single post. The default site editor doesn’t make such a distinction within single post templates. Such a distinction is left for themes to implement if they so desire.

    Thread Starter Lars-Christian

    (@larscsim)

    Thanks bcworkz. I thought post formats had been deprecated by this point!

    As for conditionals, I went that way to solve this one in the end. Saved myself having to modify the templates, too, with the help of the Block Logic plugin.

    I guess my question is more to do with the documentation here. Am I reading it entirely wrong? Because to me it explicitly states that this should be possible. I don’t understand what needs to be changed in a theme for it support what’s mentioned in the documentation.

    Moderator bcworkz

    (@bcworkz)

    From the doc page you linked:

    creation of templates that can be applied to posts

    Note that “posts” is plural. Meaning you can have an archive template for posts within a particular category. It’s not singular where you could have different singular templates based on an assigned category.

    Singular or plural is a small but important distinction ?? I agree that conditional logic is the best solution for what you want, given the named template limitations.

    BTW, I don’t see any deprecation notices regarding the various post format related functions like set_format(). I think it’s still a thing, although infrequently used. TBH, it’s not a feature I ever cared for, but being opt-in, I don’t mind that it’s available to any others that want it.

    Thread Starter Lars-Christian

    (@larscsim)

    Thanks again bcworkz!

    I hear your argument. Still, I’m reading “posts” as the plural of single posts within a category. If it referred to post archives, I would to read that term. Especially since the term “Category Archives” is used in the interface that’s shown on the documentation. It was this mismatch between terms that convinced me that I must be missing something, because I thought the text couldn’t be referring archives templates given the wording.

    And thanks for the update on the post formats ??

    Anyway, you’ve answered my question thoroughly, and this thread can safely be closed now.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Site editor: Custom template for specific category’ is closed to new replies.