Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Genesis Markup for Foundation
<?php
function ssfg_add_markup_class( $attr, $context ) {
// default classes to add
$classes_to_add = apply_filters ('ssfg-classes-to-add',
// default foundation markup values
array(
'site-header' => 'row',
'site-container' => 'inner-wrap',
'site-footer' => 'row',
'content-sidebar-wrap' => 'row',
'content' => array('small-12', 'medium-7', 'large-8', 'column'),
'sidebar-primary' => 'column',
'archive-pagination' => 'clearfix',
),
$context,
$attr
);
// lookup class from $classes_to_add
$class = isset( $classes_to_add[ $context ] ) ? $classes_to_add[ $context ] : '';
// apply any filters to modify the class
$class = apply_filters( 'ssfg-add-class', $class, $context, $attr );
// append the class(es) string (e.g. 'span9 custom-class1 custom-class2')
$attr['class'] .= ' ' . sanitize_html_class( $class );
return $attr;
}
?>
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.