Answer the question
In order to leave comments, you need to log in
Before output on different pages?
I wondered ...
WordPress has a menu that is displayed in two different places and on different pages with different css.
Wordpress has an option to add an additional class ("Css Classes (Optional)") to the menu.
For each item, I made my own extra class for the :before output and put my extras in "CSS Classes (Optional)".
But these dopas are displayed in two different places and on different pages. On that page, what is needed is displayed as it should, but on the other page, respectively, anyhow.
Question:
Is it possible to make these extras appear only on a specific page?
If possible, how?
What options can be done so as not to produce the same menu for these purposes?
Answer the question
In order to leave comments, you need to log in
Standard practice is to use body_class() and cascade style differences from the desired class. If there are not enough regular classes - on the same page there is a code example of how to add your own custom one, depending on the conditions.
If you are not satisfied with the cascade option, you can write your own Walker, where you can check and assign classes depending on your conditions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question