Site logo

Archived topic

CSS only on category pages

3 replies · Started by Michael on August 15, 2021

Viewing posts 1–4 of 4

Long story short (apt)

I have a large quote block at the start of several posts from a few categories. The excerpt is grabbing that which is fine. However in the category pages, the look wasn't good. GP seemed to ignore the excerpt length in the customiser and showed the full quote. I found some useful CSS code which nicely truncated this down to 6 lines, looked great. However the same CSS is also truncating the quote in the post itself.

Question therefore is how do I get this CSS to work only on category pages. I've tried adding archive category to the class, but that didn't register. The only difference I see in the CSS is that the category entries have post-id's as part of their CSS.

#main .wp-block-quote p{display:-webkit-box;overflow:hidden;-webkit-line-clamp:6;-webkit-box-orient:vertical;overflow:hidden}
is what I'm using to truncate the long text on the category pages.

Thanks for that explanation Leo.

No problem :)

This archived topic is closed to new replies.