I need a query to show posts with same "publish date" as related posts. For Ex. if the post is published in 2012-08-02, i want to show other posts which are published in 2012-08-02 in bottom of the post. Is there any solution? Thank You.
Get the date of current post:
$date = get_the_date('Y-m-d');
Get year, month and day from the $date variable.
$exploded = explode('-', $date); $year = $exploded; $month = $exploded; $day = $exploded;
Lastly, query the posts that has the same publish date.
$args = array( 'post_type' => 'post', 'post_status' => 'publish', 'date_query' => array( array( 'year' => $year, 'month' => $month, 'day' => $day, ), ), ); $query = new WP_Query( $args );
Add any query arguments and display the query results as you wish.