• Hello all. I am scratching my head, trying to understand what is going on here, and I wonder if anyone has encountered this problem before, and if so, what solution he or she had.

    I am trying to arrange the posts appearance by ID and not by date with this query: (So, the first posts I created will show first)

    query_posts($query_string . 'cat=7&orderby=ID&order=ASC');
    if (have_posts()) :
    echo '<h3 class="web">Websites:</h3>';
    	while (have_posts()) : the_post(); ?>
    	 <div class="post" id="post-<?php the_ID(); ?>">
    								<?php the_excerpt_reloaded(50, '<span><a><img>', 'none', TRUE, 'Read More &raquo;', TRUE, 0, FALSE); ?>
    
    	</div>
    <?php endwhile; ?>
    
    <?php endif; ?>

    The problem is, that I have a post I created last and I want it to show as one of the first, so what I did was to change its ID in the DB. But with all that, it is still shows up at the end of the list.

    Any idea why it happens?

    Appreciate your help with this matter. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Order by ID is not an available option. You can order by these:
    ‘author’, ‘date’, ‘category’, ‘title’, ‘modified’, ‘menu_order’

    Thread Starter thenut

    (@thenut)

    My bad, I confused it with the get_posts() function. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Orderby=ID doesn’t work. Instead I get orderby= post_date’ is closed to new replies.