Hay ya thats helpful but im using wishlist member plug in and using this code
<?php
// https://www.gravityhelp.com/forums/topic/changing-the-background-color-of-a-post
// filter the body class
add_filter( 'body_class', 'adzoom_wishlist_member_classes' );
// function to add body class based on wishlist member weekly, 180 day or 365 day
function adzoom_wishlist_member_classes ($classes) {
// grab the current user's wishlist member levels
global $current_user;
$user_id = $current_user->ID;
$levels = wlmapi_get_member_levels($user_id);
$levels = $levels['levels']['level'];
// these three if statements will all run, no matter what, in case there are multiple membership levels possible for a member?
// not sure if that's possible, but the wlmapi_get_member_levels returns an array, which could be multiple membership levels
// add the membership levels to the body class
if(in_array(365, $levels)) {
// add 'year-member' to the $classes array
$classes[] = 'year-member';
}
if(in_array(180, $levels)) {
// add 'half-year-member' to the $classes array
$classes[] = 'half-year-member';
}
if(in_array('weekly', $levels)) {
// add 'week-member' to the $classes array
$classes[] = 'week-member';
}
// return the $classes array no matter what
return $classes;
}
?>
then trying to change the background on some posts using this
<body <?php body_class($class); ?>>
in the header.php file
what do you think? Im not using a custom template for category.php just this
https://www.nichedeliverysystem.com/category/jobs-classifieds/
so the 1st 2 ads / posts should have a yellow back ground but dont??
can you see the issue?