Permalink
Browse files

Correct class name when custom post/page templates are housed in a su…

…b-directory.
  • Loading branch information...
1 parent ab09fc5 commit 5111dd385e2c1b434738a2517d121b4dcc53a133 @justintadlock committed Jul 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 functions/context.php
View
@@ -325,7 +325,7 @@ function hybrid_body_class( $class = '' ) {
$post = get_queried_object();
/* Checks for custom template. */
- $template = str_replace( array ( "{$post->post_type}-template-", "{$post->post_type}-", '.php' ), '', get_post_meta( get_queried_object_id(), "_wp_{$post->post_type}_template", true ) );
+ $template = str_replace( array ( "{$post->post_type}-template-", "{$post->post_type}-" ), '', basename( get_post_meta( get_queried_object_id(), "_wp_{$post->post_type}_template", true ), '.php' ) );
if ( !empty( $template ) )
$classes[] = "{$post->post_type}-template-{$template}";

0 comments on commit 5111dd3

Please sign in to comment.