• Hi

    just wondering if there is a way to add a template to a specific category. For example, to add a widget at the top of the display page. I have added templates for pages but not sure if the same can be done with categories.

    I would like to have a featured image at the top of each category which can be changed from the widgets.

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter WordDug

    (@worddug)

    I am following the below so have a category-(my category slug).php and also tried it with category-636.php but it still picks up the archive.php template.

    If I modify the archive.php template I can get the result I want but it applies to all categories.

    Im therefore not sure how to do this with the theme.
    cheers

    —————–
    In the case of categories, the hierarchy is fairly simple. For instance, suppose the slug of the Category in question is news and the Category ID is 6. The Template Hierarchy specifies that WordPress will use the first Template file it finds in your current Theme’s directory from the following list:

    category-slug.php
    category-ID.php
    category.php
    archive.php
    index.php

    Thread Starter WordDug

    (@worddug)

    I actually got this to work by creating a page template for the specific category so that the category redirects to the page. It was working ok with less than 10 posts but when the category went into a second page it wouldnt display page 2.

    Just wondering the best way to do this (if possible). Display posts from a category on a page in the same CSS and formatting as the archive.php so that I can add a widget/sidebar.

    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Category Template’ is closed to new replies.