Skip to content

Instantly share code, notes, and snippets.

@celsofabri
Created December 15, 2014 12:21
Show Gist options
  • Save celsofabri/f89954af76927eb8e061 to your computer and use it in GitHub Desktop.
Save celsofabri/f89954af76927eb8e061 to your computer and use it in GitHub Desktop.
Page Slug Body Class / Slug da página como classe
<?php
// Page Slug Body Class
function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
}
add_filter( 'body_class', 'add_slug_body_class' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment