Create a gist now

Instantly share code, notes, and snippets.

@ideag /single.php
Last active Aug 29, 2015

What would you like to do?
<?php
$post_id = 500
$p = get_post($post_id);
$args = array(
'date_query' => array(
'before' => $p->post_date,
// 'after' => $p->post_date
'inclusive' => true,
),
'exclude'=>$post_id
);
$posts = get_posts($args);
print_r($posts);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment