WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Using get_cat_ID (3 posts)

  1. rwwood
    Member
    Posted 3 years ago #

    I'm trying to develop a template that gives a listing of either category titles or post titles, depending on whether the link points to a category that is just a parent of other categories or to a category that has posts.

    So far I have the following:

    <h2 class="pagetitle">
      <?php single_cat_title(); ?>
    </h2>
    <div class="list-page">
     <ul>
      <?php wp_list_categories('orderby=name&child_of=4&title_li='); ?>
     </ul>

    Obviously, this works fine for the one category in question, which has none of its own posts but a parent to other categories. I'm at a loss however for how I need to alter this for my desired result.

    Thanks for any help.

  2. rwwood
    Member
    Posted 3 years ago #

    I should have mentioned why I used the title for the thread that I did. I'm trying to figure out how to use get_cat_ID to supply the "child_of" argument for wp_list_categories.

    Thanks.

  3. rwwood
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.