Archived topic
target last level child categories
5 replies · Started by johnaps on February 28, 2021
Hello.
Is there a way to target last level child product categories?
I want to give different margin to .woocommerce-result-count element than it is in all other levels...
As you can see this element in last level child product categories is wrongfully positioned as opposed to all other pre-levels of the product categories.
Pre-level child category (or parent product category, its the same layout) example: https://staging-sofianosorthopedikagr.kinsta.cloud/%CE%B1%CE%BD%CE%B1%CF%80%CE%B7%CF%81%CE%B9%CE%BA%CE%AC-%CE%B1%CE%BC%CE%B1%CE%BE%CE%AF%CE%B4%CE%B9%CE%B1/%CE%B1%CE%BD%CE%B1%CE%B2%CE%B1%CF%84%CF%8C%CF%81%CE%B9%CE%B1-%CE%B1%CE%BD%CE%B1%CF%80%CE%B7%CF%81%CE%B9%CE%BA%CE%AC-%CE%B1%CE%BC%CE%B1%CE%BE%CE%AF%CE%B4%CE%B9%CE%B1/
Can i target it somehow??
You help would be very much appreciated!!!
Hi there,
Not quite sure what you are referring to here.
Can you show a screenshot?
https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots
Hi Johnaps,
You can use chrome's developer tool, if you are using a windows computer, go to the page press F12, or right click > inspect.
You can find this class in body tag.
https://www.screencast.com/t/FdU02rjrGfz
You can add css like this:
.term-8014 {
your-custom-css;
}
Yes one "bad" way would be to do it like this or with .page-id-number classes to target all last level product category pages. But this isnt "dynamic" and also i would have to list over 30-50 different css classes...
I want to know if there is a way even with javascript, if you can point me somewhere to look, that i can target all last level product categories...
You ll see the difference in "last level child product categories" vs "(parent)/(pre-last level child) product categories" if you navigate to the above links that i have sent.
The first link is an example of a "last level child product category".
And the second link is an example of a "(parent)/(pre-last level child) product category".
KIND REMINDER
Hi there,
Sorry for the late reply.
Unfortunately I'm not aware of a method to do this dynamically.
You could try checking with WooCommerce' support team or open a topic in a general WordPress forum like this:
https://wordpress.stackexchange.com/
Please be mindful of what we can support here:
https://generatepress.com/what-support-includes/
Thanks!