I'm wondering if it is easy to define certain templates in line with the hierarchy from the publish groups.

For example, i've the next category structure.

-> Top Level Category

--> Second Level Category

---> Third Level Category

What i wish to have the ability to do is use toplevel.php for just about any top level groups which are added, secondlevel.php for just about any second level groups and thirdlevel.php for just about any third level groups.

Performs this seem sensible? ... essentially a website landing page for each category thats added.


This really is totally possible. You may create templates per specific groups by proclaiming them within the template title 'category-slug.php' or specify specific code inside the template that changes according to category. You can examine the wordpress documentation for specifics to what you're searching for:


You might want to do this. Published on Worpress discussion board: Original Post

<?php if (is_category()) {
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
        // This is the Template for Category level 1
    else    {
        // This is the Template for Category level 2
} ?>