Problem: several parts of the website should hide/display META-Information differently
Default: in Admin-Panel the Meta-Information can bei either shown or hidden, but not category-specific
put following function into themes / lib / functions / contex.php or in your own function.php
function HeliListCatString($PostID) {
$post_categories = wp_get_post_categories( $PostID );
foreach($post_categories as $c){
$cat = get_category( $c );
$r = $r . ' ' . $cat->slug;
}
return trim($r);
}
now you can put in the same file contex.php following bold line in the function mysite_body_class - within the part starting with is_singular
function mysite_body_class( $class = array() ) {
.....
# Is singluar post
if( is_singular() ) {
.....
$classes[] = $post->ID;
$classes[] = HeliListCatString($post->ID);
if( $type == 'portfolio' )
......
having done that you get for your post new body-class CSS tags that refer to the category-slugs. Now you can specific put meta on/off depending on the body-class by adding into your style.css
having post-meta in the admin-panel ON I do now following:
here I switch showing post-meta off for entire site but put it ON in the sites part categorized with slug RESEARCH
/*CSS Declarations: turn META OFF in entire site / turn META ON in RESEARCH Branche */
* p.post_meta {display:none;}
body.RESEARCH p.post_meta {display:block;}













