WordPress.org

Forums

[resolved] How to get ordered list of Categories and Posts? (1 post)

  1. deko
    Member
    Posted 9 years ago #

    I'm trying to get output that looks like this:

    Category1
    PostA
    PostB
    Category2
    PostC
    PostD
    PostE
    ...etc etc.

    I've used get_posts to get a listing of posts:

    <?php $posts = get_posts('numberposts=50');
    foreach($posts as $post) : setup_postdata($post); ?>
    <div id="post-list"><a href="<?php the_permalink(); ?>"
    id="post-<?php the_ID(); ?>">
    <?php the_title(); ?></a>
    </div>
    <?php endforeach; ?>

    Is there a template tag I could use in conjunction with this to get the results I am looking for?

    Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags