Forums

Ordering posts by date not working (4 posts)

  1. senormunoz
    Member
    Posted 3 years ago #

    Hi all
    I have add a list into my wordpress theme at http://noticias.dechiclana.com I'm triying to order by date excluding one category but there is no way...

    <?php $the_query = new WP_Query('cat=' .$catid2.  '&showposts=10&order=desc');
    while ($the_query->have_posts()) : $the_query->the_post();
    $do_not_duplicate = $post->ID; ?>
  2. Evita
    Member
    Posted 3 years ago #

    Try

    <?php $the_query = new WP_Query('cat=' .$catid2.  '&showposts=10&orderby=date&order=desc');
    while ($the_query->have_posts()) : $the_query->the_post();
    $do_not_duplicate = $post->ID; ?>
  3. senormunoz
    Member
    Posted 3 years ago #

    Hi Evita! Sorry... no way... Right now the site is running your code...
    Thank you so much for your help!!! (and if you think something different, please dont hesitate to write again!!! :D )

  4. Evita
    Member
    Posted 3 years ago #

    Maybe

    <?php $the_query = new WP_Query('cat=-2&showposts=10&orderby=date&order=desc');
    while ($the_query->have_posts()) : $the_query->the_post();
    $do_not_duplicate = $post->ID; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.