• Resolved nashvilledesignz

    (@nashvilledesignz)


    I am having issues where blog posts are ordering asc with oldest first and I have tried everything I can think of to get this to order in descending with newest first… can someone please help

    Here is my current code:

    <?php if (have_posts()) : while (have_posts()) : the_post();?>
    
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    <div class="clearfix" style="margin-top: 25px; color: rgb(129, 131, 130); font-size: 95%;">
    <?php if (in_category('7', $id)) { ?>
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    <?php if (function_exists('ratings_table')) ratings_table(); ?>
    <?php } else { ?>
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    <?php } ?>					
    
    <br /><br />
    <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?> | <?php the_tags('Tags: ',', ',''); ?>
    <br /><br />
    
    				</div>
Viewing 10 replies - 1 through 10 (of 10 total)
  • http://codex.ww.wp.xz.cn/Template_Tags/query_posts

    sounds like you might need to change the query to suit your needs

    Hi,

    Refer this article in order to set the psot order;

    [spam link moderated]

    Thanks,

    Shane G.

    Typically WordPress does sort post in newest to oldest order so you might consider that a plugin is doing that. Of course that assumes sticky posts are the problem…

    But you can try to change this:
    <?php if (have_posts()) : while (have_posts()) : the_post();?>

    to

    <?php query_posts($query_string . '&orderby=date&order=DESC'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post();?>

    Thread Starter nashvilledesignz

    (@nashvilledesignz)

    I tried MichaelH’s tip but its still sorting itself from oldest to newest and I want newest to oldest…there are no sticky posts so thats not an issue either…any other suggestions?

    Something must be messing with your query. Like MichaelH said, WP by default orders newest to oldest, and if specifically adding the ‘order=’ doesn’t do it… well, even more odd.

    Kill your plugins– all of them. If that doesn’t help, do you have this trouble with the default theme?

    Thread Starter nashvilledesignz

    (@nashvilledesignz)

    yep it looks as though even the default theme is having issues where its oldest to newest…what could be causing this?

    Did you kill your plugins?

    Have you checked your database for errors? If you have access to PhpMyAdmin, you can browse the DB and get warnings about table corruptions.

    Thread Starter nashvilledesignz

    (@nashvilledesignz)

    Just disabled all of them…so its a plugin…let me tinker around with those plugins…hopefully I can get this all cleared up today.

    Thank you!

    Which plugin, if you don’t mind?

    Hello, whoa change the post to –

    <?php query_posts($query_string . ‘&orderby=date&order=ASC’); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post();?>

    or

    <?php query_posts($query_string . ‘&orderby=date&order=ASC’); ?>
    <?php while (have_posts()) : the_post(); ?>

    You need ascending not descending..LOLS does it work ?

    Try Both see which works for you.

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

The topic ‘ASC and DESC’ is closed to new replies.