• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / twentysixteen_body_classes() – Adds custom classes to the array of body classes.

You appear to be a bot. Output may be restricted

Description

Adds custom classes to the array of body classes.

Usage

$array = twentysixteen_body_classes( $classes );

Parameters

$classes
( array ) required – Classes for the body element.

Returns

array (Maybe) filtered body classes.

Source

File name: twentysixteen/functions.php
Lines:

1 to 23 of 23
function twentysixteen_body_classes( $classes ) {
  // Adds a class of custom-background-image to sites with a custom background image.
  if ( get_background_image() ) {
    $classes[] = 'custom-background-image';
  }

  // Adds a class of group-blog to sites with more than 1 published author.
  if ( is_multi_author() ) {
    $classes[] = 'group-blog';
  }

  // Adds a class of no-sidebar to sites without active sidebar.
  if ( ! is_active_sidebar( 'sidebar-1' ) ) {
    $classes[] = 'no-sidebar';
  }

  // Adds a class of hfeed to non-singular pages.
  if ( ! is_singular() ) {
    $classes[] = 'hfeed';
  }

  return $classes;
}
 

 View on Trac

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: twentysixteen_body_classes
Plugin ref: Twenty Sixteen
Version: 2.8
Sourcefile: functions.php
File ref: functions.php
Deprecated?: No
API Letters: B,C,T

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.28
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites