Created
July 31, 2014 09:50
-
-
Save ideag/5217ccd7b0fd32a1fbc9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
add_filter('pre_get_posts', 'klausk_category_post_types'); | |
function klausk_category_post_types($query) { | |
if((is_category() && $query->is_main_query()) { | |
$post_type = get_query_var('post_type'); | |
if($post_type) | |
$post_type = $post_type; | |
else | |
$post_type = array('post','resort'); | |
$query->set('post_type',$post_type); | |
} | |
return $query; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment