Reference › Functions twentyfourteen_body_classes ( array $classes ): array
Since Twenty Fourteen 1.0
Source wp-content/themes/twentyfourteen/functions.php:613Description Parameters Return Uses Source History Extends 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 ↗
613 function twentyfourteen_body_classes ( $classes ) { 614 if ( is_multi_author ( ) ) { 615 $classes [ ] = 'group-blog' ; 616 } 617 618 if ( get_header_image ( ) ) { 619 $classes [ ] = 'header-image' ; 620 } elseif ( ! in_array ( $GLOBALS [ 'pagenow' ] , array ( 'wp-activate.php' , 'wp-signup.php' ) , true ) ) { 621 $classes [ ] = 'masthead-fixed' ; 622 } 623 624 if ( is_archive ( ) || is_search ( ) || is_home ( ) ) { 625 $classes [ ] = 'list-view' ; 626 } 627 628 if ( ( ! is_active_sidebar ( 'sidebar-2' ) ) 629 || is_page_template ( 'page-templates/full-width.php' ) 630 || is_page_template ( 'page-templates/contributors.php' ) 631 || is_attachment ( ) ) { 632 $classes [ ] = 'full-width' ; 633 } 634 635 if ( is_active_sidebar ( 'sidebar-3' ) ) { 636 $classes [ ] = 'footer-widgets' ; 637 } 638 639 if ( is_singular ( ) && ! is_front_page ( ) ) { 640 $classes [ ] = 'singular' ; 641 } 642 643 if ( is_front_page ( ) && 'slider' === get_theme_mod ( 'featured_content_layout' ) ) { 644 $classes [ ] = 'slider' ; 645 } elseif ( is_front_page ( ) ) { 646 $classes [ ] = 'grid' ; 647 } 648 649 return $classes ; 650 } 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 7.1.0 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.