Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…b-directory.
  • Loading branch information...
commit 5111dd385e2c1b434738a2517d121b4dcc53a133 1 parent ab09fc5
@justintadlock authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  functions/context.php
View
2  functions/context.php
@@ -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}";
Please sign in to comment.
Something went wrong with that request. Please try again.