Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created May 9, 2019 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djrmom/706af8475cdf47edc8ceba30e04f3b7e to your computer and use it in GitHub Desktop.
Save djrmom/706af8475cdf47edc8ceba30e04f3b7e to your computer and use it in GitHub Desktop.
facetwp change template div to ul
<?php
/** changes <div class="facetwp-template" in facetwp template shortcode output to a ul
** will not work if facetwp_use_pager_seo is true
**/
add_filter( 'facetwp_shortcode_html', function( $output, $atts ) {
if ( !empty( $atts['template'] ) && 'example' == $atts['template'] ) { // change "example" to your template name
$output = str_replace( '<div class="facetwp-template"', '<ul class="facetwp-template"', $output );
$output = substr_replace( $output, '</ul>', -6 );
}
return $output;
}, 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment