1

My theme's archive template uses this for the loop,

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

Seems to be ordered by post title but I need them ordered by the post id. Just need help with the syntax i think. How do I change the order of the loop list of posts or incorporate this in to the loop? I am researching this but if anyone has a simple solution I would be extremely grateful.

$args = array(
    'orderby'  => 'ID',
    'order' => 'ASC',
);
$query = new WP_query ( $args );
3
0

I used this Sort results by name & asc order on Archive.php

changed to select the archive template if(is_archive( 'taxonomy-places.php')):

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.