{"action":"opened","issue":{"url":"https://api.github.com/repos/DoSomething/dosomething-blog/issues/87","labels_url":"https://api.github.com/repos/DoSomething/dosomething-blog/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/DoSomething/dosomething-blog/issues/87/comments","events_url":"https://api.github.com/repos/DoSomething/dosomething-blog/issues/87/events","html_url":"https://github.com/DoSomething/dosomething-blog/issues/87","id":114117477,"number":87,"title":"Only show \"Our Blog\" posts on homepage","user":{"login":"DFurnes","id":583202,"avatar_url":"https://avatars.githubusercontent.com/u/583202?v=3","gravatar_id":"","url":"https://api.github.com/users/DFurnes","html_url":"https://github.com/DFurnes","followers_url":"https://api.github.com/users/DFurnes/followers","following_url":"https://api.github.com/users/DFurnes/following{/other_user}","gists_url":"https://api.github.com/users/DFurnes/gists{/gist_id}","starred_url":"https://api.github.com/users/DFurnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DFurnes/subscriptions","organizations_url":"https://api.github.com/users/DFurnes/orgs","repos_url":"https://api.github.com/users/DFurnes/repos","events_url":"https://api.github.com/users/DFurnes/events{/privacy}","received_events_url":"https://api.github.com/users/DFurnes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-29T18:33:04Z","updated_at":"2015-10-29T18:33:04Z","closed_at":null,"body":"The homepage is currently showing all posts, but it should only be showing posts explicitly placed in the \"Our Blog\" category... we can do this by using the [pre_get_posts](http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts) hook to limit what gets queried [like so](http://stackoverflow.com/a/24575201):\r\n\r\n```php\r\nfunction exclude_category( $query ) {\r\n    if ( $query->is_home() && $query->is_main_query() ) {\r\n        $query->set( 'cat', 'YOUR CATEGORY ID HERE' );\r\n    }\r\n}\r\nadd_action( 'pre_get_posts', 'exclude_category' );\r\n```"}}