Skip to content

Instantly share code, notes, and snippets.

@codehooligans
Last active August 29, 2015 14:13
Show Gist options
  • Save codehooligans/0b3b2d4a69fa16101cbc to your computer and use it in GitHub Desktop.
Save codehooligans/0b3b2d4a69fa16101cbc to your computer and use it in GitHub Desktop.
Codehooligans.com: my Home Posts Filter
<?php
// Used to limit the categories displayed on the home page.
function myHomePostsFilter($query)
{
if ($query->is_home)
{
$query->set('cat','1');
}
return $query;
}
add_filter('pre_get_posts','myHomePostsFilter');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment