add_filter('body_class','browser_body_class') breaks my theme
-
Here is the function I’ve been using since WP 3.0. to add an ancestor class to my <body>.
Now in WP 3.5 beta1, this function breaks my theme.
Any idea?
add_filter('body_class','browser_body_class'); function browser_body_class($classes = '') { global $post; $parent = array_reverse(get_post_ancestors($post->ID)); if($post->post_parent == 0){ $classes[] = 'no-ancestor'; } else { $classes[] = 'ancestor-'.$parent[0]; } return $classes; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘add_filter('body_class','browser_body_class') breaks my theme’ is closed to new replies.