WordPress.org

Ready to get started?Download WordPress

Forums

Retrieve posts grouped alphabetically (2 posts)

  1. leemon
    Member
    Posted 2 years ago #

    Hi,

    I'm developing a plugin and I need it to show all published posts grouped alphabetically. Something like this:

    A
    post
    post
    ...

    B
    post
    post
    ...

    C
    post
    post
    ...

    and so on.

    I'm wondering if it's possible to retrieve all post grouped this way using the get_posts() function.

    Any help anyone can offer in pointing me in the right direction would be much appreciated, as would specific suggestions.

    Thanks

  2. s_ha_dum
    Member
    Posted 2 years ago #

    Sort by 'post_title'-- aka 'orderby'=>'post_title'. You will get posts in alphabetical order by post title, but you won't get that grouping exactly. You will have to construct that yourself.

Topic Closed

This topic has been closed to new replies.

About this Topic