• I just jumped MT to WP and love everything about it…until i met “The Template Tags.” Suddenly WP’s apparent simplicity went totally out the window. Case in point: I’m trying to get a list of categories on the side bar that either includes or excludes categories. I have:
    Issues
    – 01
    – 02
    Articles
    Insights
    Specifically, this tag:
    <?php wp_list_cats(''); ?>
    According to the template tag manual (great, but apparently for codeheads only), I can add
    * ‘exclude’ – string – These are the categories to exclude from the list
    or
    * categories – integer array – A list of categories to be displayed. This should be in the form of an array.
    Neither explanation gives any clues as to how to style the option/parameters. The manual is too vague, and I’m sure this is a basic PHP thing, but for non-PHP users, it’s Greek.
    So I don’t know if inside the parenthesis I should put:
    (‘exclude’-Issues-) or (‘exclude=Issues’) or what.
    Can someone define how these are written or point somewhere (other than the Template Tags manual) that explains this in clear language?
    Thanks.
    Gary

Viewing 4 replies - 1 through 4 (of 4 total)
  • Same Q!
    I switched to 1.2 mostly to get child categories, but my template doesn’t show them.
    ‘<li id=”categories”>Categories:

      ‘<?php list_cats(1, ”, ‘name’); ?>

    ‘ </li
    so I want to use the full comand to get the chill’n displayed,b ut I don’t understand the parameter descriptions and use. i think I’m stuck on “categories”.
    From http://wiki.wordpress.org/list_cats:
    “A list of categories to be displayed. This should be in the form of an array.” What’s that form? …, ‘1,2,3’, … or …, (“1”, “2”, “3”), … or ???
    A broader Q might touch on how to apply use of these:
    <?php list_cats(optionall, ‘all’, ‘sort_column’, ‘sort_order’, ‘file’, list, optiondates, optioncount, hide_empty, use_desc_for_title, children, child_of, categories, recurse, ‘feed’, ‘feed_image’, ‘exclude’); ?>
    The descriptions are not clear for me: e.g. the format for arrays, when you can leave ”?, do all parameters need to be included?
    Any answers?

    Okay, not sure about the include categories, but for exclude you need to use the category ID numbers (from the categories admin screen ), then list them between ” e.g: ‘6,5,7’ and I believe you need to set ALL of the options (either on or off) when using the function.
    I’m trying to find out about the include cats myself.

    that’s not quite right…I’ve found that ‘1,2,3’ doesn’t form the array that they’re asking for. It gives an error every time.

    Try this for displaying child categories: http://wiki.wordpress.org/TheCategoryFixed

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Category Tag options/paramaters/arrays…what?’ is closed to new replies.