Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created November 16, 2018 14:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djrmom/83fe136e9bf2c22a1a8af6a04d91ba5c to your computer and use it in GitHub Desktop.
Save djrmom/83fe136e9bf2c22a1a8af6a04d91ba5c to your computer and use it in GitHub Desktop.
facetwp add additional classes/id to layout template
<?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 );
@CollinHell
Copy link

Very helpful, thanks!

@tinhochu
Copy link

thank you! 👏

@schutzsmith
Copy link

Wow! Saved me in a pinch - thank you!

@marcinkrzeminski
Copy link

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment