From 371b5a8f55a39ddd2a15fda88bff7aec2ae6c314 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@11054 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 8317aa9a6..0ebcbc5b9 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';