views:

19

answers:

1

hi

i am creating a theme which consists of two pages, blog and portfolio. therefore i have categories which related to the portfolio posts (ie. web design, graphic design) and categories relating to the blog posts (ie. tutorials, todos)

i have two pages (/blog and /portfolio), in each, i would like to show the list of categories related on to the specific types

(i may not be clear) so this is an example:

all categories: cat1, cat2, cat3, cat4, cat5,cat6

for portfolio: 
<ul>
<li><a>cat1</a></li>
<li><a>cat2</a></li>
<li><a>cat3</a></li>
</ul>

for blog:
<ul>
<li><a>cat4</a></li>
<li><a>cat5</a></li>
<li><a>cat6</a></li>
</ul> 

so is there a way to split them like that

thanks

A: 

You can use wp_list_categories() method in your template, this method takes an "exclude" or "exclude_tree" parameter, which allows you to exclude blog categories in the first list, and portfolio in the second.

http://codex.wordpress.org/Template_Tags/wp_list_categories

mamoo
i have seen tutorials which use complex if statements (which didnt work for me) so i didn't this wp_list_categories() does this - thanks a lot
aurel