Change color post by Category
-
Can someone help me?
So this is the problem: I’m trying to change the color of the post when you hover the post (in a grid, like metro style), but the color change by category.
I already tried something like
global $post; if(is_single($post->ID)): $class[] = 'post'; else: $category = get_the_category($post->ID); if($category[number]): $class[] = 'bg-class';
but doesnt work.
also, I’m sorry but I’m new with php.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Change color post by Category’ is closed to new replies.