• Hi

    I have two major category types for my events, all other categories are listed in one of these. How can i hide these two top level categories from the category listing page? It’s fine to keep them in permalinks, but when listing categories, i need to hide them.

    Is it possible?

    Thanks

Viewing 1 replies (of 1 total)
  • Use the following code snippet to hide the parent categories (it’s hiding any category without a parent).

    add_filter( 'em_categories_output_categories', function( $terms ) {
        $newterms = [];
        foreach ($terms as $term) {
            if ($term->parent != 0) {
                $newterms[] = $term;
            }
        }
        return $newterms;
    } );

    You can use the Code Snippets plugin to add this code snippet.

Viewing 1 replies (of 1 total)
  • The topic ‘Hide parent categories from listing’ is closed to new replies.