How can I style all posts from a category on blog page?

Posted in: Newspaper
Post count: 6

Need to be able to style all posts from a category on the blob page.
Looking at the code, all posts are wrapped in td_module_wrap div, but there is other information passed on.

Ideally Category ID would appear as a class so it could be styled.
Is there another way to achieve this?

Post count: 20688

Hi,

There would be no way of differentiating between the same module type by category, on a blog page. On a static page built with a page-builder there would be more control,custom classes can be set for each block, row or other various elements
https://www.screencast.com/t/iym4M2SJ
That way you can individualize sections of the page if you want to create design for it.

Thanks

Post count: 6

So after some research, and for my case, I have found that I can edit a /modules .php file to attempt to add in additional classes.

Default line is:
<div class="<?php echo $this->get_module_classes();?>">

I am not 100% what code to add into the class, but would something like get_categories work? Bearing in mind I want to have post categories listed as class names on the blog page.

I am unsure on the syntax.
Does anyone have an idea?

Post count: 6

Think I have resolved this using post_class
Function Reference/post class

Can now discreetly style posts from particular categories on the blog page to highlight them as required.

  • This reply was modified 8 years by trafffic.
Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.