Reference › Functions twentyfourteen_body_classes ( array $classes ): array
Since Twenty Fourteen 1.0
Source wp-content/themes/twentyfourteen/functions.php:602Description Parameters Return Uses Source History Extend the default WordPress body classes.
Description Adds body classes to denote: <ol> <li>Single or multiple authors.</li> <li>Presence of header image except in Multisite signup and activate pages.</li> <li>Index views.</li> <li>Full-width content layout.</li> <li>Presence of footer widgets.</li> <li>Single views.</li> <li>Featured content layout.</li> </ol>
Parameters
$classesarray A list of existing body class values. Return
array The filtered body class list. Uses · 11 is_multi_author() Determines whether this site has more than one author. get_header_image() Retrieves header image for custom header. is_archive() Determines whether the query is for an existing archive page. is_search() Determines whether the query is for a search. is_home() Determines whether the query is for the blog homepage. is_active_sidebar() Determines whether a sidebar contains widgets. is_page_template() Determines whether the current post uses a page template. is_attachment() Determines whether the query is for an existing attachment page. is_singular() Determines whether the query is for an existing single post of any post type (post, attachment, page, custom post types). is_front_page() Determines whether the query is for the front page of the site. get_theme_mod() Retrieves theme modification value for the active theme. Source View on Trac ↗ View on GitHub ↗
602 function twentyfourteen_body_classes ( $classes ) { 603 if ( is_multi_author ( ) ) { 604 $classes [ ] = 'group-blog' ; 605 } 606 607 if ( get_header_image ( ) ) { 608 $classes [ ] = 'header-image' ; 609 } elseif ( ! in_array ( $GLOBALS [ 'pagenow' ] , array ( 'wp-activate.php' , 'wp-signup.php' ) , true ) ) { 610 $classes [ ] = 'masthead-fixed' ; 611 } 612 613 if ( is_archive ( ) || is_search ( ) || is_home ( ) ) { 614 $classes [ ] = 'list-view' ; 615 } 616 617 if ( ( ! is_active_sidebar ( 'sidebar-2' ) ) 618 || is_page_template ( 'page-templates/full-width.php' ) 619 || is_page_template ( 'page-templates/contributors.php' ) 620 || is_attachment ( ) ) { 621 $classes [ ] = 'full-width' ; 622 } 623 624 if ( is_active_sidebar ( 'sidebar-3' ) ) { 625 $classes [ ] = 'footer-widgets' ; 626 } 627 628 if ( is_singular ( ) && ! is_front_page ( ) ) { 629 $classes [ ] = 'singular' ; 630 } 631 632 if ( is_front_page ( ) && 'slider' === get_theme_mod ( 'featured_content_layout' ) ) { 633 $classes [ ] = 'slider' ; 634 } elseif ( is_front_page ( ) ) { 635 $classes [ ] = 'grid' ; 636 } 637 638 return $classes ; 639 } History Introduced in Twenty Fourteen 1.0 . Unchanged from 6.7.7 through 7.1.0.
6.7.7 6.8.8 6.9.7 7.0.4 7.1.0 Signature, return type and hooks compared across 5 parsed releases.
About this page Parsed data Generated from the wordpress-develop 6.8.8 tag, from src/wp-content/themes/twentyfourteen/functions.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. Corrections Something wrong on this page? Report it and it gets fixed in the next regeneration.