Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

CollinHell commented Jun 11, 2019

Very helpful, thanks!

@tinhochu

This comment has been minimized.

Copy link

tinhochu commented Oct 12, 2019

thank you! 👏

@schutzsmith

This comment has been minimized.

Copy link

schutzsmith commented Nov 8, 2019

Wow! Saved me in a pinch - thank you!

@marcinkrzeminski

This comment has been minimized.

Copy link

marcinkrzeminski commented Jan 10, 2020

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.