Skip to content

Instantly share code, notes, and snippets.

@ringmaster
Created May 30, 2012 21:10
Show Gist options
  • Save ringmaster/2838993 to your computer and use it in GitHub Desktop.
Save ringmaster/2838993 to your computer and use it in GitHub Desktop.
Get a post, find posts with any of the same tags that match
<?php
$post = Posts::get(array('slug' => 'habari', 'fetch_fn' => 'get_row'));
$related = Posts::get( array( 'vocabulary' => array( 'any:tags' => $post->tags) ) );
Utils::debug($post->title, $related);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment