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:
ryan 2009-04-22 17:46:51 +00:00
parent 64091e195f
commit 371b5a8f55
1 changed files with 3 additions and 0 deletions

View File

@ -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';