Last active
January 9, 2016 00:14
-
-
Save secretstache/13987600d6cede114f1e to your computer and use it in GitHub Desktop.
Genesis Markup for Foundation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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