• Hi Friends,

    Trying to have it so that there could be a way so that I could get the posts to show in reverse order of what they are now on the page below. I want to have it so that the posts go in reverse order.. most recent post at the top.

    http://pac3carbondale.com/news/

    Anyone know how I could possibly do this? Only trouble is that it differs from the way posts are set up on the home page. Perhaps I could set up a query or something?

    any help would be greatly appreciated

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi mixmastermichael,

    You could use query_posts() to reorder your post.
    Check this page out for more details.

    http://codex.wordpress.org/Function_Reference/query_posts

    Thread Starter mixmastermichael

    (@mixmastermichael)

    Thanks for the reply.

    I tried using

    <?php $posts = query_posts( $query_string . ‘&orderby=title&order=asc’ ); ?>

    on the home page posts , and

    <?php

    global $query_string;
    $page = get_query_var(‘page’);
    if (is_category()) query_posts($query_string . “&posts_per_page=$post_number”. ‘&orderby=date&order=desc’);
    else query_posts($query_string . “&showposts=$post_number&paged=$page”);
    ?>

    for the News category, but it’s just not working.

    I’ve got the ascending order posts to show up for now by using the “Custom Post Order” plugin – but the trouble is that it applies to all sections of the site, including the categories. I need it so that the News category page does not display stuff in Ascending order, but Descending.

    I’ve re-enabled the custom post order for now. Any ideas?

    What’s the php file name for displaying the category like category.php?

    And can you paste the whole code in the category php file?
    Please use pastebin.com

    Will see the code and let you know what we can do.

    Thread Starter mixmastermichael

    (@mixmastermichael)

    thanks for lending a hand.

    Here’s the pastebin file for the “blog page” where those posts are coming in.

    http://pastebin.com/HhpXJqiY

    Looking forward to a response.
    Thanks!

    The code you paste is the custom template for Blog page, but I’m not 100% sure if you want to display the category posts within this custom template as well.

    What I understood was you want to display News category in a descending order.
    Is that right?

    Then try this:

    if (is_category('News')) {
    	query_posts('showposts=$et_ptemplate_blog_perpage&cat=news_cat_id&order=DESC');
    }

    and change news_cat_id to the news category id.

    Also it seems you are using Elegant Themes so may need to configure ET settings.

    Thread Starter mixmastermichael

    (@mixmastermichael)

    Okay, thanks so much for the reply. We’re getting somewhere…. So I looked within ET settings, and there’s a setting to get it so that the posts would appear in Descending order on the categories. The only thing is that there’s not a way to do that on the main blog pages, so it would probably have to be done manually I would imagine?

    I put <?php $posts = query_posts( $query_string . ‘&orderby=title&order=asc’ ); ?> in the index.php file, but it didn’t seem to do anything. I’ve reverted to use the Custom Post plugin for now which is how the posts on the site are in reverse order, but will need to get rid of that since it applies to ALL posts on the site including the Category pages.

    This theme is great but confusing… Seems like nothing I try when I add a query like below to the index.php seems to make a difference.
    <?php query_posts($query_string.”&orderby=date&order=ASC”); ?>

    I tried adding the code you suggested to the blog.php page, but it didn’t seem to do anything. There is no category.php or archives.php file anywhere within the site… weird.

    Any other ideas?? If I could first get the posts on the home page to simply appear in ascending order it would then probably work when I have the ET category settings to DESC.

    Thread Starter mixmastermichael

    (@mixmastermichael)

    bump?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Get posts to show up in reverse order on one category only’ is closed to new replies.