Changeset 6797 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
- Timestamp:
- 02/27/2018 11:31:19 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-main/functions.php
r6658 r6797 85 85 ] ); 86 86 } 87 88 if ( is_page() ) { 89 $page = get_queried_object(); 90 91 if ( $page->post_parent && 'about' === get_post( $page->post_parent )->post_name ) { 92 wp_enqueue_script( 'wporg-navigation', get_theme_file_uri( '/js/navigation.js' ), [], '20151215', true ); 93 } 94 } 87 95 } 88 96 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\scripts' ); … … 98 106 $cdn_handles = [ 99 107 'wporg-page-stats', 108 'wporg-navigation', 100 109 ]; 101 110 … … 119 128 function body_class( $classes ) { 120 129 if ( is_page() ) { 121 $classes[] = 'page-' . get_query_var( 'pagename' ); 130 $page = get_queried_object(); 131 132 $classes[] = 'page-' . $page->post_name; 133 134 if ( $page->post_parent ) { 135 $parent = get_post( $page->post_parent ); 136 137 $classes[] = 'page-parent-' . $parent->post_name; 138 } 122 139 } 123 140
Note: See TracChangeset
for help on using the changeset viewer.