Site logo

Archived topic

target last level child categories

5 replies · Started by johnaps on February 28, 2021

Viewing posts 1–6 of 6

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.

Last-level child category 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/%CF%83%CF%85%CF%83%CE%BA%CE%B5%CF%85%CE%AD%CF%82-%CE%B1%CE%BD%CE%AC%CE%B2%CE%B1%CF%83%CE%B7%CF%82/

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 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

This archived topic is closed to new replies.