do I just paste the code in functions.php?
-
I see a lot of tutorials like this,
https://zeo.unic.net.my/exclude-category-in-wordpress/
that say to just paste a code anywhere in the funtions.php but when I do that the code either appears as body text on all my pages or a I get some scary error
My functions.php only has this
<?php if ( function_exists('register_sidebar') ) register_sidebar(); ?>
and I’m trying to add this
function exclude_category($query) { if ( $query->is_feed ) { $query->set('cat', '-5'); } return $query; } add_filter('pre_get_posts', 'exclude_category');
Please help! I must be doing something wrong..
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘do I just paste the code in functions.php?’ is closed to new replies.