Skip to content

Instantly share code, notes, and snippets.

@dtsn
Created September 6, 2013 11:01
Show Gist options
  • Save dtsn/6462381 to your computer and use it in GitHub Desktop.
Save dtsn/6462381 to your computer and use it in GitHub Desktop.
$callback = $_GET['callback'];
$posts = [];
if (have_posts()) {
while(have_posts()) {
array_push(the_post());
}
}
print $callback . '(' . json_encode($posts) . ')';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment