Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. /**
  2. *
  3. * Add classes to genesis html structures for foundation grid
  4. *
  5. */
  6.  
  7. add_filter('genesis_attr_content-sidebar-wrap', 'custom_class');
  8. function custom_class( $attr, $class ) {
  9.  
  10. $site_layout = genesis_site_layout();
  11.  
  12. // Do not add row class to full width content pages
  13. if ( 'full-width-content' == $site_layout ) {
  14.  
  15. $attr['class'] .= '';
  16. return $attr;
  17.  
  18. }
  19.  
  20. // Add row class to all other site layout templates (centers content-sidebar-wrap by adding row)
  21. else {
  22.  
  23. $attr['class'] .= ' ' . ('row' );
  24. return $attr;
  25.  
  26. }
  27.  
  28. }
  29.  
  30.  
  31. add_filter( 'genesis_attr_content', 'custom_do_attributes_content_classes' );
  32.  
  33. function custom_do_attributes_content_classes1( $attr, $class ) {
  34.  
  35. if (is_single() ) {
  36. $attr['class'] .= ' ' . ('large-10 columns' );
  37. }
  38. $site_layout = genesis_site_layout();
  39. if ( 'full-width-content' == $site_layout ) {
  40. $attr['class'] .= ' ' . ('large-16 columns' );
  41. }
  42. else {
  43. $attr['class'] .= ' ' . ('medium-10 columns' );
  44. }
  45.  
  46. return $attr;
  47.  
  48. }
  49.  
  50.  
  51. add_filter( 'genesis_attr_sidebar-primary', 'custom_do_attributes_primary_sidebar_classes' );
  52.  
  53. function custom_do_attributes_primary_sidebar_classes( $attr, $class ) {
  54.  
  55. if ( is_single() ) {
  56. $attr['class'] .= ' ' . ('large-6 columns' );
  57. }
  58. else {
  59. $attr['class'] .= ' ' . ('medium-6 columns' );
  60. }
  61.  
  62. return $attr;
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement