WordPress.org

Ready to get started?Download WordPress

Forums

query_post from the current date only (2 posts)

  1. alvarols
    Member
    Posted 1 year ago #

    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
  2. esmi
    Forum Moderator
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags