is_category / in_category -> echo value from array
-
Hi,
I’m trying to echo a value from an array with several names of categories.
The problem is that I can’t figure out how to echo the specific value (=the category) rather than the word “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. '" '; } }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘is_category / in_category -> echo value from array’ is closed to new replies.