WordPress.org

Support

Support » Installation » Different Format for Different Categories?? Is that possible?

Different Format for Different Categories?? Is that possible?

  • Hi All,

    I’d like to know if it’s possible for me to format the article content in different ways for different categories. Like different font size, or include/exclude post date etc.

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator cubecolour

    @numeeja

    ɹoʇɐɹǝpoɯ

    Yes you can do that. You just have to make separate tempates for any categories which you want to be different.
    http://codex.wordpress.org/Category_Templates

    Thanks, Numeeja. I think there’s a gap between what I know and what the article talks about.

    So when I create a new category, how do I choose which template to apply to it? I don’t see that option…

    So, if you want to make the Category whose ID number is 6 look different from what it is currently (and different from other Category pages), you would want to create a category-6.php file. If you want to make all Category pages look different from other archive pages (such as date and author archives), then you would want to create or modify the category.php file. If you want to make changes to the look of all archive pages, you can create or modify the archive.php file. And if you modify the index.php file, you will affect your entire blog.

    Batrachoid, I read and reread that part, but I still can’t figure out how to apply a category to a specific template. In the admin GUI, when I create a new category, there’s no option to apply a template to it.

    Sure I can create “category-6.php” but where and how do I specify its use?

    “So, if you want to make the Category whose ID number is 6 look different from what it is currently (and different from other Category pages), you would want to create a category-6.php file.”

    I wasn’t aware that categories had ID numbers, only slugs.

    Moderator cubecolour

    @numeeja

    ɹoʇɐɹǝpoɯ

    Go to posts -> categories
    When you hover over a category name you should be able to read its numerical ID in the bar at the bottom of the browser.

    if not it is displayed in the address bar when you click the link. Once you have the ID for the category, create your custom template with the appropriate name and WordPress will use it.

    kt83,

    You don’t have to apply a template to a category, just create a file with the appropriate name, as described above, and WP will use it.

    ok, thanks a lot for all your help

    in which folder do I create the category-6.php file? I use customized templates

    Ok, I’ve got the category thing figured out. Thanks.

    Now, how do I edit the homepage so that previews of articles from category-6 look different from previews of articles from the default categories? I’m talking about the homepage where the most recent articles are previewed.

    for example: for category-6 articles, I want a date to appear right under the title, but not for other categories.

    So I’ve now customized categories, can I customize the articles in those categories?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Different Format for Different Categories?? Is that possible?’ is closed to new replies.
Skip to toolbar