WordPress.org

Make WordPress Core

Ticket #10361: 10361.diff

File 10361.diff, 522 bytes (added by Denis-de-Bernardy, 9 years ago)
  • wp-includes/post-template.php

     
    427427
    428428                $classes[] = 'page-id-' . $pageID;
    429429
    430                 if ( $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' LIMIT 1", $pageID) ) )
     430                if ( empty($wp_query->post->ancestors) )
    431431                        $classes[] = 'page-parent';
    432432
    433433                if ( $wp_query->post->post_parent ) {