Add page-id-x class to body for pages. jamescollins. see #7939
git-svn-id: http://svn.automattic.com/wordpress/trunk@11054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
64091e195f
commit
371b5a8f55
|
@ -419,6 +419,9 @@ function get_body_class( $class = '' ) {
|
||||||
setup_postdata($wp_query->post);
|
setup_postdata($wp_query->post);
|
||||||
|
|
||||||
$pageID = $wp_query->post->ID;
|
$pageID = $wp_query->post->ID;
|
||||||
|
|
||||||
|
$classes[] = 'page-id-' . $pageID;
|
||||||
|
|
||||||
if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' LIMIT 1", $pageID) ) )
|
if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' LIMIT 1", $pageID) ) )
|
||||||
$classes[] = 'page-parent';
|
$classes[] = 'page-parent';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue