Subcategories editing
-
I found the snippet for “”
works great! but when I click on a Subcategory it now says “no category found” on the subcategory page (the sub categories in my case do not have additional sub categories) I could not find a simple way to modify the snippet to apply to only Top Level categories, can you help?
add_action( "adverts_sh_list_before", "categories_above_adverts_list" ); function categories_above_adverts_list( $args ) { global $wp_query; if( is_tax( 'advert_category' ) ) { $current_category = $wp_query->get_queried_object_id(); // code for getting the sub categories and displaying them here $columns = "adverts-flexbox-columns-4"; $show_count = 0; $terms = get_terms( 'advert_category', array( 'hide_empty' => 0, 'parent' => $current_category , 'number' => 0 ) ); include ADVERTS_PATH . '/templates/categories-top.php'; } }
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Subcategories editing’ is closed to new replies.