Genesis Theme Support
Default theme supports #
Genesis adds the following theme supports to Genesis child themes by default:
add_theme_support( 'menus' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'title-tag' );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'body-open' );
add_theme_support( 'genesis-inpost-layouts' );
add_theme_support( 'genesis-archive-layouts' );
add_theme_support( 'genesis-admin-menu' );
add_theme_support( 'genesis-seo-settings-menu' );
add_theme_support( 'genesis-import-export-menu' );
add_theme_support( 'genesis-customizer-theme-settings' );
add_theme_support( 'genesis-customizer-seo-settings' );
add_theme_support( 'genesis-auto-updates' );
add_theme_support( 'genesis-breadcrumbs' );
These enable the following features:
Feature | Description |
---|---|
menus | WordPress menus. |
post-thumbnails | See post thumbnails. |
title-tag | See title tag. |
automatic-feed-links | See automatic feed links. |
body-open | Show plugin developers that the theme uses the wp_body_open function. |
genesis-inpost-layouts | Genesis layouts for posts and pages. |
genesis-archive-layouts | Genesis layouts on archives. |
genesis-admin-menu | Displays the Genesis menu. |
genesis-seo-settings-menu | Displays the Genesis SEO settings menu. |
genesis-import-export-menu | Displays the Genesis import/export menu. |
genesis-customizer-theme-settings | Adds Genesis theme settings to the Customizer. |
genesis-customizer-seo-settings | Adds Genesis SEO settings to the Customizer. |
genesis-auto-updates | Adds a UI option to enable Genesis update checks. |
genesis-breadcrumbs | Genesis breadcrumb features and options. |
To opt-out of these, you can remove support in your child theme's functions.php
with the remove_theme_support()
function:
remove_theme_support( 'automatic-feed-links' );
Opt-in theme supports #
You can add support for additional WordPress and Genesis features using the add_theme_support()
WordPress function in your child theme's functions.php
file.
HTML5 #
We strongly recommend that you add the WordPress HTML5 theme support to ensure Genesis outputs HTML5 and not XHTML:
add_theme_support(
'html5',
array(
'caption',
'comment-form',
'comment-list',
'gallery',
'search-form',
)
);
Genesis accessibility #
Add support for Genesis accessibility features (also strongly recommended).
add_theme_support(
'genesis-accessibility',
array(
'drop-down-menu',
'headings',
'search-form',
'skip-links',
)
);
Option | Description |
---|---|
drop-down-menu | Add scripts to improve accessibility of drop-down menus. |
headings | Add additional headings for screen reader users to aid navigation. |
search-form | Improve search form labels. |
skip-links | Add skip links markup. |
Genesis menus #
Add a Primary and Secondary navigation menu with given names:
add_theme_support(
'genesis-menus',
array(
'primary' => __( 'Primary Menu', 'genesis-sample' ),
'secondary' => __( 'Secondary Menu', 'genesis-sample' ),
)
);
Genesis structural wraps #
Add div
elements with a .wrap
class to wrap HTML that Genesis outputs. This can assist with styling for full-width layouts.
add_theme_support(
'genesis-structural-wraps',
array(
'header',
'menu-primary',
'menu-secondary',
'footer-widgets',
'footer'
)
);
Genesis after entry widget area #
Add a widget area after post entries. Useful for calls to action.
add_theme_support( 'genesis-after-entry-widget-area' );
Genesis footer widget areas #
Add the given number of footer widget areas. You must provide your own CSS to control the layout of these.
add_theme_support( 'genesis-footer-widgets', 3 );
Genesis image lazy loading #
WordPress 5.5 adds lazy loading of images by default, including images embedded in pages or posts. Genesis image lazy loading support is no longer necessary and should be removed.
For WordPress versions prior to 5.5, add support for lazy loading of images:
add_theme_support( 'genesis-lazy-load-images' );
Genesis will then add a “loading” attribute with a value of “lazy” via the wp_get_attachment_image_attributes
filter. Images that are output without that filter running will not gain the loading attribute.
The wp_get_attachment_image_attributes
filter does not affect iframes or images embedded in pages and posts. By default the filter runs on images that WordPress outputs via the wp_get_attachment_image
function, such as featured images.