Created
November 16, 2018 14:23
-
-
Save djrmom/83fe136e9bf2c22a1a8af6a04d91ba5c to your computer and use it in GitHub Desktop.
facetwp add additional classes/id to layout template
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 | |
/** add additional classes / id to the facetwp-template div generated by a facetwp | |
** layout template | |
**/ | |
add_filter( 'facetwp_shortcode_html', function( $output, $atts) { | |
if ( $atts['template'] = 'example' ) { // replace 'example' with name of your template | |
/** modify replacement as needed, make sure you keep the facetwp-template class **/ | |
$output = str_replace( 'class="facetwp-template"', 'id="masonry-container" class="facetwp-template small-up-1 medium-up-2 large-up-3"', $output ); | |
} | |
return $output; | |
}, 10, 2 ); |
thank you! 👏
Wow! Saved me in a pinch - thank you!
❤️
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very helpful, thanks!