• Resolved geckoinbelize

    (@geckoinbelize)


    I want to display my posts in alphabetical order rather than by date. I have previously used
    <?php if (have_posts()) : while (have_posts()) : the_post('&orderby=title&order=asc'); ?>
    but when I put this in the index.php file it makes no difference.

    Will this not work with this theme or is there another way to achieve an alphabetical list?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You might want to check out this page in the Codex

    http://codex.wordpress.org/Alphabetizing_Posts

    Thread Starter geckoinbelize

    (@geckoinbelize)

    Hi – as I wanted to change all my categories to show alphabetically I edited the functions.php to include the example shown at the bottom of this codex but they still only show by date. I tried putting it in the Child theme, and also in the main theme but it made no difference. Any suggestions?

    You might want to check out some plugins that will do custom ordering…apparently they exist. Do a search in the plugins with the keywords “Post Ordering”

    Thread Starter geckoinbelize

    (@geckoinbelize)

    I found a solution – putting the following code before the loop in the category.php of the child theme did exactly what i needed.

    <?php if (is_category()) { $posts = query_posts($query_string . '&orderby=title&order=asc'); } ?>

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Sorting posts by title’ is closed to new replies.