Forum Replies Created
-
AuthorPosts
-
FurlazMember
It's me again 🙂
I found !!
I use this function ://* Add a custom class add_filter( 'genesis_attr_entry-meta-before-content', 'ldw_my_custom_class' ); function ldw_my_custom_class( $attributes ) { if ( in_category('category-1') ) { $attributes['class'] = $attributes['class'] . ' category-1-class'; } else if ( in_category( 'category-2' ) ) { $attributes['class'] = $attributes['class'] . ' category-2-class'; } else if ( in_category( 'category-3' ) ) { $attributes['class'] = $attributes['class'] . ' category-3-class'; } if ( is_category( 'category-1' ) ) { $attributes['class'] = $attributes['class'] . ' category-1-class'; } else if ( is_category( 'category-2' ) ) { $attributes['class'] = $attributes['class'] . ' category-2-class'; } else if ( is_category( 'category-3' ) ) { $attributes['class'] = $attributes['class'] . ' category-3-class'; } return $attributes; }
And it works perfectly !
Thanks for your help William 🙂
FurlazMemberI have a track. I found this : http://victorfont.com/genesis-framework-add-a-custom-css-class-to-elements/
With this element "genesis_attr_entry-meta-before-content", it add a custom class perfectly where I want.
Now, I just need to detect my category for each iteration of the loop... possible ? 🙂FurlazMemberIf you have an idea, I say yes 🙂
It's a website for a cliente (it's on a developpement environnement) : http://emetjen-dev-nounoune_et_ses_tifs.pf3.wpserveur.net/
Actually, I changed the background color of my all category tag but now, I would like a different color depending on the category 🙂FurlazMemberHi William,
Thank you very much for your answer 🙂
I had seen this code on the studiopress (I searched before lol)In my case, I would like to change the background-color for each category tag on my home page (with the list of my posts).
So, if I change my body class, the change will be for the whole page and not every post.Is it clear ? (I'm not bilingual ^^)
-
AuthorPosts