Changeset 39650
- Timestamp:
- 12/30/2016 05:46:58 AM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/src/wp-content/themes/twentyseventeen/functions.php
r39575 r39650 55 55 56 56 add_image_size( 'twentyseventeen-thumbnail-avatar', 100, 100, true ); 57 58 // Set the default content width. 59 $GLOBALS['content_width'] = 525; 57 60 58 61 // This theme uses wp_nav_menu() in two locations. … … 200 203 function twentyseventeen_content_width() { 201 204 202 $content_width = 700; 203 204 if ( twentyseventeen_is_frontpage() ) { 205 $content_width = 1120; 205 $content_width = $GLOBALS['content_width']; 206 207 // Get layout. 208 $page_layout = get_theme_mod( 'page_layout' ); 209 210 // Check if layout is one column. 211 if ( 'one-column' === $page_layout ) { 212 if ( twentyseventeen_is_frontpage() ) { 213 $content_width = 644; 214 } elseif ( is_page() ) { 215 $content_width = 740; 216 } 217 } 218 219 // Check if is single post and there is no sidebar. 220 if ( is_single() && ! is_active_sidebar( 'sidebar-1' ) ) { 221 $content_width = 740; 206 222 } 207 223 … … 215 231 $GLOBALS['content_width'] = apply_filters( 'twentyseventeen_content_width', $content_width ); 216 232 } 217 add_action( ' after_setup_theme', 'twentyseventeen_content_width', 0 );233 add_action( 'template_redirect', 'twentyseventeen_content_width', 0 ); 218 234 219 235 /**
Note: See TracChangeset
for help on using the changeset viewer.