/ Published in: PHP

the numbers 108 and 18 are the category ids i wanted to exclude
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
add_action('pre_get_posts', 'gloss_remove_glossary_cat' ); function gloss_remove_glossary_cat( $notused ) { global $wp_query; global $gloss_category; // Figure out if we need to exclude glossary - exclude from // archives (except category archives), feeds, and home page if( ( is_archive() )) { $wp_query->query_vars['cat'] = '-108,-18' . $gloss_category; } }
Comments
