I am trying to get all posts to be displayed on a certain date.
For example today Tuesday I want all posts to be displayed. It doesn't matter that the posts were created today (Tuesday) or last week or last year - I just want a loop that will display all post of the current day.
Tomorrow (Wednesday) I want all post to be displayed.
I have created this code but it isn't working for me and I am getting a little frustrated.
Here is my code.
<?php
$day = date('j');
query_posts( 'day='.$current_day);
query_posts('cat=9&posts_per_page=2' );
if (have_posts()) :
while (have_posts()) :
the_post(); ?>
<div id="eventTitle">
<span class="thetimeevent">
<?php the_field('time'); ?>
</span>
<a href="<?php the_permalink() ?>" class="eventFeed">
<?php the_title(); ?>
</a>
</div>
<?php
endwhile;
endif;
wp_reset_query();
?>
Thank you for any help in advance :)
query_posts
. I'm almost certain I once told you this before. Might be wrong though. UseWP_Query
. BTW, you cannot use two instances ofquery_posts
the way you did.