Create a Template for the posts under a selected category only

For example, I have created 2 templates (A & B) to use for the posts. But, I’d like to have template A to use with the posts that fall under the selected categories(cat A, B, C & D).

This means, if those posts fall under category A, template A will be in use. Otherwise, I will be using another template.

Let me know if you don’t get what I mean. I tried choosing terms and select the category, but it doesn’t work.

Looking forward to hearing from you.
Thank you!

Regards,
Jornes

Hi @jornes

When editing your template - >template settings - >template conditions - > add conditions & choose ‘terms’ you should find it in there.

*you may need to set two conditions, 1. for ‘posts’, then the second for ‘terms’ (if it does not not show the terms when using one condition.

Hope that helps mate.

@Michael

Thank you Michael.
I’ll try it out shortly. :slight_smile:

Worked for me, exactly what I was looking for. Thanks to both of you.

As an expansion on this question - If a post has two categories, with each of those categories having different templates, which of the two templates are used?

I guess another way of asking this is - When there are multiple templates whose conditions match a post, which template has precedence?

That’s a really good question! :+1:

I guess the way to find out would be to give it a go - The easiest way would be to create two very basic templates. one template with the number 1 and the other template with number 2. Assign them both a category and add them both to the page or post and then see which number shows up