I've created a function to add a class to the body, however if should only apply to a single page ID. This normally wouldn't be a problem, but it is breaking the layout for other pages.
Filter Function
add_filter('body_class','add_blog_to_body_class');
function add_blog_to_body_class($classes) {
$classes[] = 'blog';
return $classes;
}
My Condition (that isn't working)
function add_blog_to_body_class($classes) {
$classes[] = 'blog';
if ( is_page('ID') ) {
return $classes;
}
}
I've wrapped the entire function, the declaration, the add_filter
hook, and everything without luck.
How can I have this function work on a single page ID?
ID
as a place holder. I'm working on page ID 40 :)