Skip to content

Instantly share code, notes, and snippets.

@secretstache
Last active January 9, 2016 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save secretstache/13987600d6cede114f1e to your computer and use it in GitHub Desktop.
Save secretstache/13987600d6cede114f1e to your computer and use it in GitHub Desktop.
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