At first I thought the task was trivial. I'd like to list the most recently added posts (say, 15 of them), but I am adding posts that are dated a few years back, yet I'd like them to show in the list, instead of just the ones that are dated the most recent.
This is what I'm doing so far:
<?php $args = array( 'orderby' => 'modified', 'numberposts' => 15 ); $postslist = get_posts( $args ); foreach ($postslist as $post) : setup_postdata($post); $audio = get_children( array( 'post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'audio' ) ); $thishref = ""; foreach ( $audio as $attachment_id => $attachment ) : $thishref.= wp_get_attachment_url( $attachment_id, 'full' ); endforeach; ?> <li> <a href="<?php the_permalink(); ?>"><?php the_title();?></a> <span title="comments" class="commentCount">(<?php comments_number( '0', '1', '%' ); ?>)</span> <a title="download" class="downloadlink" href="<?php echo $thishref; ?>">↓</a> </li> <?php endforeach; ?>
It works, except if I add tags to a post or edit it in any way, the post becomes 'modified' and thus appears in this list, and I'd like to prevent this from happening.
In other words, I want to list 15 most recent posts not by their date, not by their modified date, but by the date they were added to the database of posts ('created' date?).
Would this be at all possible?