Customized landingpages for categories

When I click on a category now, it looks like..

Category Archives: MyCategory

Read More

first post

second post

third post..

I want to customize these landing pages for special categories, add text, pictures, html.

How do I do that, easiest way, w/o plugins.
There might be a file to be cloned, like content-category-mycategory.php?

Related posts

Leave a Reply

1 comment

  1. Here is the Template Hierarchy, which gives you an overview of the different approaches.

    You could create for each category an individual PHP file:

    • either category-{CATEGORY ID}.php
    • or category-{CATEGORY SLUG}.php.

    Or you could use a single file category.php in which you define the output (as well as its layout, style etc.) according to the current category – again, either depending on its ID or its slug.

    Here’s a short example using the ID:

    $category = get_the_category();
    $cat_ID = $category[0]->cat_ID;
    switch ($cat_ID) {
        case 'A':
            ...
            break;
        case 'B':
            ...
            break;
        default:
            ...
    }