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';
- if ( $wp_query->post->post_parent )
+ if ( $wp_query->post->post_parent ) {
$classes[] = 'page-child';
$classes[] = 'parent-pageid-' . $wp_query->post->post_parent;
-
- if ( is_page_template() )
+ }
+ if ( is_page_template() ) {
$classes[] = 'page-template';
$classes[] = 'page-template-' . str_replace( '.php', '-php', get_post_meta( $pageID, '_wp_page_template', true ) );
+ }
} elseif ( is_search() ) {
if ( !empty($wp_query->posts) )
$classes[] = 'search-results';
* @param array|string $args
*/
function wp_page_menu( $args = array() ) {
- $defaults = array('sort_column' => 'post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
+ $defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
$args = wp_parse_args( $args, $defaults );
$args = apply_filters( 'wp_page_menu_args', $args );