• I’m programming a newspaper on WordPress. And I want to make a loop where appears the writer’s articles from the current day only.

    How can I do that with the wp_query because I need to call the posts from a certain category on a static page, like this:

    <?php $events_query = new WP_Query('cat=9&posts_per_page=6'); ?>
                                <?php if(have_posts()) : ?><?php while($events_query->have_posts()) : $events_query->the_post(); ?>
                                    <div class="columnista">
                                        <div class="lafoto">
                                            <?php userphoto_the_author_photo(); ?>
                                        </div>
                                        <div class="textopluma">
                                            <h1 class="negrochico"><a href="<?php the_permalink(); ?>" class="tooltip" title="<?php echo get_excerpt(250); ?>"><?php the_title(); ?></a></h1>
                                            <p class="author"><?php the_author_posts_link(); ?></p>
                                        </div>
                                    </div>
                                <?php endwhile; ?>
                                <?php wp_reset_query(); ?>
                                <?php endif; ?>
    
    Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘query_post from the current date only’ is closed to new replies.