Skip to content

Commit

Permalink
Reinstated body_class() per Theme-Check requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
splorp committed Jan 1, 2014
1 parent 74a3960 commit 4110372
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
16 changes: 16 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
12 changes: 2 additions & 10 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,13 @@
<?php wp_head(); ?>
</head>

<body>
<body <?php body_class( $class ); ?>>
<header>
<?php if ($tersus_announcement_display == "1"): ?>
<section id="announcement">
<?php echo (stripslashes($tersus_announcement)); ?>
</section>
<?php endif; ?>

<?php
// Removed body_class() call from body element
// We may want to revisit this at a later date
// and provide a custom function which allows
// page-level ids or classes instead
?>

<?php endif; ?>
<h1><a href="<?php echo home_url(); ?>/" title="Back to the home page"><?php bloginfo('name'); ?></a></h1>
<p><?php bloginfo('description'); ?></p>
</header>
Expand Down

0 comments on commit 4110372

Please sign in to comment.