From 41103722a3cd6f55b9bca42a5d694f59e9008270 Mon Sep 17 00:00:00 2001 From: Grant Hutchinson Date: Wed, 1 Jan 2014 13:50:57 -0700 Subject: [PATCH] Reinstated body_class() per Theme-Check requirements --- functions.php | 16 ++++++++++++++++ header.php | 12 ++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/functions.php b/functions.php index d088a39..d237519 100644 --- a/functions.php +++ b/functions.php @@ -210,6 +210,22 @@ function register_my_menus() { add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) ); +// Replace default body class verbosity + +function simple_body_class($wp_class_list, $simple_class_list) { + // List allowed classes + $whitelist = array('home', 'page', 'single', 'attachment', 'archive', 'search', 'error404'); + + // Filter the unwanted classes + $wp_class_list = array_intersect($wp_class_list, $whitelist); + + // Output allowed classes + return array_merge($wp_class_list, (array) $simple_class_list); +} + +add_filter('body_class', 'simple_body_class', 10, 2); + + // Replace default post class verbosity function simple_post_class() { diff --git a/header.php b/header.php index a24cc34..f1852b0 100644 --- a/header.php +++ b/header.php @@ -51,21 +51,13 @@ - + >
- - - - +