0

I was searching about changing the default template of the categories in WordPress, I saw the codex which says that the only way by making a new file with the slug or the ID of the category, like this Category-ID.php or Category-SLUG.php

But I want to know if there's a way to add a dropdown menu with different templates when making new categories, just like pages..

Is it even possible? If so, how?

  • Yes it is possible. It should not be done this way(responding/ansswering as I do now) but here is a link for a "how to" Maybe using google is next time also an option before asking? – Charles May 30 '15 at 5:11
  • @Charles It's really old plugin, didn't even work! – 99teko May 30 '15 at 19:42
  • Maybe looking here for the answer, his plugin works like a charm! WP 4.2.2 – Charles May 31 '15 at 1:32
  • @Charles Please consider adding it as an answer to mark the question as resolved – 99teko Jun 1 '15 at 0:41
0

You can create a custom template in the theme and give options for each category to select the template.

The custom fields for a category can be added using, 'Advanced Custom fields' plugin or you can refer this article.

Once you do this, you need to edit the 'category.php' file, to set the template for the category. You will have to use the custom field value to select and load the corresponding template. You can use, 'get_template_part()' function for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.