Last active
August 29, 2015 14:13
-
-
Save codehooligans/0b3b2d4a69fa16101cbc to your computer and use it in GitHub Desktop.
Codehooligans.com: my Home Posts Filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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