Hello,
I was wondering how to use css on specific categories from the grid view in the blog posts. I want to add a border to the top of the box in the grid view using various colors.
Thanks,
Hi Pappasdg!
Can you post the link to your page and a screenshot showing the changes you would like to make?
Cheers!
Yigit
Hi!
Add this as from line 120 in custom.css
.avia-content-slider .slide-entry{
border-top-width:3px !important;
}
/*Then for each post entry, change the color of the border*/
.avia-content-slider .slide-entry.post-entry-102{
border-top-color:brown !important;
}
.avia-content-slider .slide-entry.post-entry-107{
border-top-color:brown !important;
}
/*and so forth*/
Cheers!
Arvish
Hello Arvish
Thanks for the help! However is there anyway to make it the border work by the category it is in instead of having to do it by individual posts ids?
Thanks!
Hey!
Yes, that’s possible, you’d need to edit /config-templatebuilder/avia-shortcodes/postslider.php, change this part (365-368):
$markup = avia_markup_helper(array('context' => 'entry','echo'=>false, 'id'=>$the_id, 'custom_markup'=>$custom_markup));
$output .= "<article class='slide-entry flex_column {$style} {$post_class} {$grid} {$extraClass} {$thumb_class}' $markup>";
To this:
$markup = avia_markup_helper(array('context' => 'entry','echo'=>false, 'id'=>$the_id, 'custom_markup'=>$custom_markup));
$category = get_the_category($the_id);
$output .= "<article class='slide-entry flex_column {$category[0]->slug} {$style} {$post_class} {$grid} {$extraClass} {$thumb_class} $markup>";
Now each post in that grid will get its first category slug as a class:
.avia-content-slider .slide-entry.category_slug{
border-top-color:brown !important;
}
Best regards,
Josue