Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Exclude categories from meta problem #1159301

    Hi Nikko,

    I just tried

    add_filter('get_the_terms', 'hide_categories_terms', 10, 3);
    function hide_categories_terms($terms, $post_id, $taxonomy){
    
        if (!is_admin()) {
            $exclude = array(43, 44);
            foreach($terms as $key => $term){
                if(in_array($term->term_id, $exclude)) unset($terms[$key]);
            }
        }
        return $terms;
    }

    But it’s still causing the same problem. Tried wiping cache after doing this and it still doesn’t work

    in reply to: Filter posts in both categories #1152614

    I need to show posts that have both categories and not just one.

    Thanks,

Viewing 2 posts - 1 through 2 (of 2 total)