WordPress.org

Ready to get started?Download WordPress

Forums

displaying children of categories as unordered lists (3 posts)

  1. andytford
    Member
    Posted 6 years ago #

    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:

    http://www.imxstudio.com/wordpress/New-Products-default.jpg

    ...and how I would prefer for them to display:

    http://www.imxstudio.com/wordpress/New-Products-desired.jpg

    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 ~

  2. moshu
    Member
    Posted 6 years ago #

    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

  3. iridiax
    Member
    Posted 6 years ago #

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

    <ul>
    <?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; ?>
    </ul>

Topic Closed

This topic has been closed to new replies.

About this Topic