Create a template for a specific category

Hi :slight_smile:

I am building a Wordpress Template and so far everything worked smoothly.

I have however a question: is it possible to create a template for a specific category and not just for specific post type?
For example I would like to have a template for “News” and a template for “Featured News” where “Featured News” is a category in “News”

Many thanks :slight_smile:

If you’re willing to take the limitation that the same template would be applied to all categories, you can do this with Blocs Plus right now.

Create the “category” template and apply the custom layout to this template.
In your WordPress menu you’ll need to link to the specific categories to see the layout applied. The easiest way is to add the category to your menu.

That would result in a link somewhat similar to this: Reviews Archieven - Brecht Ryckaert

Hi @brechtryckaert. I already have Blocs Plus and I was able to create a template for the Posts.

What do you mean exactly with

Create the “category” template and apply the custom layout to this template.

What I see right now is this

Screenshot 2021-11-11 at 17.23.59

How can I define in Blocs that this Template needs to be used for the “Featured News” category?

Wait a moment, I think I got it. Do I maybe need to rename my template and called it “category-featured-news”?

So I will have a “category-featured-news.php” file when I export it?

Did you ever figure this out? By convention, Wordpress looks for category-CATEGORYNAME | CATEGORY_ID.php. When I export a theme it seems like Blocs is prepending page- to my category page.

For example, in Blocs I create category-help. I expect the output to be category-help.php. However, the app outputs page-category-help.php.

What’s going on?