Category parent and its children to use different theme layout
-
Hi, im in the process of making a wordpress site and i want to have a catagory and its children use a different layout to the rest of the site.
I tried category-id.php using the parents id hoping the children of that category would also use the layout but as the catagory numbers for the children are different it doesnt work. There are 27 children for the category so want to avoid using a different category-id.php for each if i can.
I want to list the posts for this category and its children alphabetically as a list and i found this code:
<?php if (is_category('Glossary')) { $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-100'); } if (have_posts()) : while (have_posts()) : the_post(); ?>
Can i add more category id’s or names to the:
'if (is_category('Glossary'))'
if so what code would i need to use.
Then presumably after the start of the loop i would show the layout for these categories as i want then would i use:
<?php else : ?>
and after this put how i would want every other category not listed above to show.
Im new to wordpress and php and have jumped in the deep end making my own theme so thanks for any help in advance.
Nick
- The topic ‘Category parent and its children to use different theme layout’ is closed to new replies.