Created
May 9, 2019 14:33
-
-
Save djrmom/706af8475cdf47edc8ceba30e04f3b7e to your computer and use it in GitHub Desktop.
facetwp change template div to ul
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 | |
/** 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