Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Genesis Markup Filter Reference
<?php
/**
* Genesis Markup Filter Reference
*
* @author Edwin Velez (https://edwinvelez.net)
* @link https://edwinvelez.net/genesis-markup-filter-reference/
*/
// Add filters to site containers for adding classes.
add_filter( 'genesis_attr_site-container', 'ev_filter_site_container' );
add_filter( 'genesis_attr_site-inner', 'ev_filter_site_inner' );
add_filter( 'genesis_attr_site-footer', 'ev_filter_site_footer' );
/**
* Modify attributes for Genesis site-container element.
*
* @param array $attributes Existing attributes for site-container element.
*
* @return array Amended attributes assigned to site-container element.
*/
function ev_filter_site_container( $attributes ) {
// Example Usage
$attributes[ 'class' ] = trim( $attributes[ 'class' ] . ' ' );
return $attributes;
}
/**
* Modify attributes for Genesis site-inner element.
*
* @param array $attributes Existing attributes for site-inner element.
*
* @return array Amended attributes assigned to site-inner element.
*/
function ev_filter_site_inner( $attributes ) {
// Example usage.
$attributes[ 'class' ] = trim( $attributes[ 'class' ] . ' ' );
return $attributes;
}
/**
* Modify attributes for Genesis site-footer element.
*
* @param array $attributes Existing attributes for site-footer element.
*
* @return array Amended attributes assigned to site-footer element.
*/
function ev_filter_site_footer( $attributes ) {
// Example usage.
$attributes[ 'class' ] = trim( $attributes[ 'class' ] . ' ' );
return $attributes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.