WordPress.org

Ready to get started?Download WordPress

Forums

List of Subcategories & Category descriptions (4 posts)

  1. melissasue
    Member
    Posted 6 years ago #

    I'm attempting to create a fiction archive and I want to make sure that the site displays exactly as I intended so I'm dividing the stories in genres and then subdividing by story title, so my category structure looks a bit like this:

    Series >> Title of Series >> Post

    What I'd like to do is to have a category page for the parent categories that just displays the subcategories within the category and then the category descriptions for them. I was able to get the first part to work using the code here:

    [code]
    <?php if (is_category()) {
    $this_category = get_category($cat);
    if (get_category_children($this_category->cat_ID) != "") {
    echo "<h1>Stories</h1>";
    wp_list_categories('orderby=name&show_count=0&title_li=
    &child_of='.$this_category->cat_ID);
    }
    } ?>[/code]

    but I can't figure out where exactly to put the category description for it to show up as I want it to. I googled and I searched the forums but I can't find anything specific.

  2. moshu
    Member
    Posted 6 years ago #

    You have a "code" button above the text input area. Use it, that's why it is there (don't reinvent the wheel).

  3. melissasue
    Member
    Posted 6 years ago #

    I apologize -- in most of other forums I use (in fact, I have to say all of them) markup is almost always [code] or [b] so I'm just to just typing away. I attempted to edit it but it wouldn't let me.

    <?php if (is_category()) {
    $this_category = get_category($cat);
    if (get_category_children($this_category->cat_ID) != "") {
    echo "<h1>Stories</h1>";
    wp_list_categories('orderby=name&show_count=0&title_li=
    &child_of='.$this_category->cat_ID);
    }
    } ?>
  4. RichyBlue
    Member
    Posted 5 years ago #

    Have you sort it out? I am also interested in this.

    Please if you can help.

    Thank you !

Topic Closed

This topic has been closed to new replies.

About this Topic