Display Wordpress Post By Date

I want to show Wordpress post by day/date in homepage.

ex:

Monday, January 03

  • post 1
  • post 2
  • post 3

Sunday, January 02

  • post 1
  • post 2
  • post 3

Saturday, January 01

  • post 1
  • post 2
  • post 3

What Wordpress query should I use?

Thanks. Sorry for bad english.

Topic wp-query posts Wordpress

Category Web


i think your question has been answered in here

$args = array('posts_per_page' => -1, 'orderby' => 'date' );
$myQuery = new WP_Query($args);
$date = '';
if ( $myQuery->have_posts() ) : while ( $myQuery->have_posts() ) : $myQuery->the_post();
if ( $date != get_the_date() ) {
    echo $date;
    echo '<hr />';
    $date = get_the_date();
}
the_title(); // or whatever you want here.
echo '<br />';
endwhile; endif;
wp_reset_postdata();

More info on the query here: http://codex.wordpress.org/Class_Reference/WP_Query

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.