Home / loop / Display today’s posts only
  • How to Display today’s posts only


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

    ( click code to copy )

    wordpress snippet : PHP

    $day = date('j');
    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; ?>

    ( WordPress codex functions, hooks, in this snippet. )

    the_content, the_title, the_permalink, query, have_posts, the_post, query_posts,