Posts in alphabetical order

  • Anonymous

    #2343

    I noticed that several people have asked about reordering posts in the Graphene theme so that they are in alphabetical order. I have just managed to do this so I thought that I would post how I did it for the benefit of anyone else who is trying to do that too. There’s a chicken website by Member ju27 who I think this applies to for example!

    What I did was this. In the root folder of the Graphene theme files package I opened the file category.php and near the bottom of this file I added two lines:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('orderby=title&order=ASC&posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);

    They need to go just above this:

    get_template_part('loop', 'category');
    ?>
    <?php get_footer(); ?>

    Hope that helps someone and that it’s technically correct – it certainly works for me! I’d be grateful, Syahir, if you could confirm that this is an acceptable way to do the job? Thanks!

    Mod

    Kenneth John Odle

    #19895

    Keep in mind that if you edit Graphene’s core files, you will lose your changes at the next update.

    Shezza

    #19896

    Agreed – I find it pays to keep a single log file with all my changes listed in it! Very few for this theme though as it does plenty out of the box!

    Shezza

    #19897

    Having more data now I’ve discovered that this coding is wrong. Unfortunately it orders ALL the posts, and loses the categories. Can anyone tell me what I need to do to correct this please?

    Shezza

    #19898

    Can I bump this question up please? I am very keen to get my posts in alphabetical order on each category page. Help appreciated!!

    Mod

    Kenneth John Odle

    #19899

    Well, bbPress doesn’t really allow for bumping of topics. It’s pretty streamlined software. Just adding another post to the thread shoots it to the top automatically.

    In response to your question, however, you can achieve something like this quite easily by forgetting about WP’s standard category archives and using Kalin’s Post List plugin. I wrote a tutorial for this plugin here. It’s quite a powerful plugin that adds considerable functionality to WP.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.