Skip to content

Instantly share code, notes, and snippets.

@wildiney
Created September 21, 2012 13:00
Show Gist options
  • Save wildiney/3761322 to your computer and use it in GitHub Desktop.
Save wildiney/3761322 to your computer and use it in GitHub Desktop.
Adiciona uma classe no body caso exista sidebar
<?php
function wpfme_has_sidebar($classes) {
if (is_active_sidebar('sidebar')) {
// add 'class-name' to the $classes array
$classes[] = 'has_sidebar';
}
// return the $classes array
return $classes;
}
add_filter('body_class','wpfme_has_sidebar');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment