Skip to content

Instantly share code, notes, and snippets.

@ideag
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ideag/78f8f2d0661975bbba92 to your computer and use it in GitHub Desktop.
Save ideag/78f8f2d0661975bbba92 to your computer and use it in GitHub Desktop.
<?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