U
U
urajo2022-04-18 12:09:53
WordPress
urajo, 2022-04-18 12:09:53

How to display hierarchically categories of custom taxonomy?

At the moment I'm using wp_list_categories
In general, everything suits, for 1 nuance. I would like to add my own classes for different levels of links and nested lists, since it is extremely inconvenient to make up now.
I would like to at least somehow separate links with the class "link_lvl1" at least.
How to do it?
625d2a9ed5e7d466840725.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
wadowad, 2022-04-18
@wadowad

First level:
ul.categories__list>li {}
Nested level:
ul.categories__list ul li {}
Is this the question?

A
Artem Zolin, 2022-04-19
@artzolin

wp_list_categories()will give you a list with only its own, ready-made layout
You can use the filter wp_list_categoriesto edit the output of the query layout or create your own query get_terms()and write your layout the way you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question