• ramjay

    (@ramjay)


    Hello,

    I am looking for the tag of the parent category ONLY. And a tag for child categories ONLY too. Is that possible?

    Regards,
    Robert

Viewing 7 replies - 1 through 7 (of 7 total)
  • jonimueller

    (@jonimueller)

    For the second part, only show child categories of certain parent category…

    <ul>
    <?php wp_list_categories('orderby=id&show_count=1
    &use_desc_for_title=0&child_of=8'); ?>
    </ul>

    But do you want to list ONLY the child categories of ALL parents? Then you may have to include the additional parameter specifically excluding ALL parent categories and list their IDs.

    From the Codex:
    http://codex.wordpress.org/Template_Tags/wp_list_categories

    Thread Starter ramjay

    (@ramjay)

    I meant, not a list. But a category for the post. Or post’s category. Can i seperate the Parent Category and the Child Category?

    jonimueller

    (@jonimueller)

    Hmmm. I’m not sure what you mean. If it’s a post, I don’t understand how (or why) it would be separated. Separated how? There is only one post. ???

    Thread Starter ramjay

    (@ramjay)

    Example:
    This post is under the parent category of: <Parent category Here>
    This post is under the child category of: <Child category Here>

    Is it possible to seperate the codes?

    jonimueller

    (@jonimueller)

    Ah, I gotcha.
    http://codex.wordpress.org/Template_Tags/the_category

    These list all the tag parameters for the_category tag which is the one that you are looking for. I thought you meant display a list of categories on your sidebar. 🙂

    Thread Starter ramjay

    (@ramjay)

    I’ve tried these tags. But not that what I meant. Parents and Child Categories are still intouch! helP!

    Thread Starter ramjay

    (@ramjay)

    I found this page,
    http://codex.wordpress.org/Template_Tags/get_category_parents

    But can anyone help me how can I change the category id into the current post? I have tried to set it to 1, but didn’t work! Please help!

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

The topic ‘Category help!!!!!’ is closed to new replies.