From 7252c98c548df36a0beb90ac414e94fc7c47dfef Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 22 Apr 2009 17:46:51 +0000 Subject: [PATCH] Add page-id-x class to body for pages. jamescollins. see #7939 git-svn-id: https://develop.svn.wordpress.org/trunk@11054 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-template.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 8317aa9a6d..0ebcbc5b94 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -419,6 +419,9 @@ function get_body_class( $class = '' ) { setup_postdata($wp_query->post); $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) ) ) $classes[] = 'page-parent';