Hi,
I'm customizing a wordpress-theme and I'm trying to echo a value from an array (with several names of categories).
My problem: I can't figure out how to echo the specific value (= the name of the category) rather than the word "Array".
The wordpress-functions is_category() and in_category() are able to handle arrays, but the echo just prints "Array".
Could you help me? 🙂 Thanks!
function cat_background_image (){
$category_class = array('wissen', 'meinung', 'wirtschaft'); //category_names
if (is_single()) {
if(in_category($category_class)) echo 'class="bg_' .$category_class. '" ';
} else {
if(is_category($category_class)) echo 'class="bg_' .$category_class. '" ';
}
}