Last active
May 11, 2022 09:37
-
-
Save gregoirenoyelle/19489e5da8440adbd70b8efeb827d480 to your computer and use it in GitHub Desktop.
genesis-custom-markup
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 déclarée dans le fichier markup.php | |
function genesis_parse_attr( $context, $attributes = array(), $args = array() ) { | |
$defaults = array( | |
'class' => sanitize_html_class( $context ), | |
); | |
$attributes = wp_parse_args( $attributes, $defaults ); | |
// Contextual filter. | |
return apply_filters( "genesis_attr_{$context}", $attributes, $context, $args ); | |
} |
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 | |
// Template Name: Grid Layout 3 col | |
/** | |
* Ajouter une classe sur la balise entry-content | |
* @author Grégoire Noyelle | |
* @return $attributes | |
*/ | |
add_filter('genesis_attr_entry-content', 'gn_add_entry_content_class'); | |
function gn_add_entry_content_class($attributes) { | |
$attributes['class'] .= ' section-grid-layout-wrap'; | |
return $attributes; | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment