Display today’s posts only

Adding this PHP code to your wordpress theme will display your wordpress post but only from the current day.

 

 

<?php
$day = date('j');
query_posts('day='.$day);
if (have_posts()) :
while (have_posts()) : the_post();
?>
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="view: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
<div class="storycontent"><?php the_content(); ?></div>
<?php endwhile; ?>
<?php endif; ?>

Be Sociable, Share!

Leave a comment