Support » Fixing WordPress » displaying children of categories as unordered lists

  • I would like to display the children of a category as unordered lists. By default, it seems WP displays them as block items with a brief intro summary and other info such as date posted etc. I would like to simply display the child-level posts as links in an unordered list with just the title of the post as the text of the link. The following are visual examples of how the posts are displaying by default:

    …and how I would prefer for them to display:

    I have scoured the Forum prior to asking this question and there seems to be a few others with the same unresolved dilemma. Hopefully, I am asking this question as clearly as possible. And ANY help is greatly appreciated.

    Thanks in advance ~

Viewing 2 replies - 1 through 2 (of 2 total)
  • You are not displaying the “children” of a category. Children are “subcategories”.
    You want to display posts in that category. Remove every template tag from The_Loop, except the_title tag on the template file used to display the posts. It could be category-XX.php, category.php or archive.php > see Template_Hierarchy

    This will display an alphabetical list of all posts (as links) in a category.

    <?php $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1'); while (have_posts()) : the_post(); ?>
    	<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
    	<?php endwhile; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘displaying children of categories as unordered lists’ is closed to new replies.