-
AuthorPosts
-
October 30, 2014 at 6:03 pm #343506
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,
October 30, 2014 at 7:33 pm #343578Hi Pappasdg!
Can you post the link to your page and a screenshot showing the changes you would like to make?
Cheers!
YigitOctober 30, 2014 at 8:43 pm #343660This reply has been marked as private.November 2, 2014 at 8:16 am #344813Hi!
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!
ArvishNovember 7, 2014 at 5:57 pm #347829Hello 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!
November 9, 2014 at 12:39 am #348253Hey!
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 -
AuthorPosts
- You must be logged in to reply to this topic.
