Skip to content

Gists - FacetWP

Code snippets for FacetWP

Replace tag with a different tag for pager links

<?php
/** 
 ** replace <a> with <span> for pager
 **/
add_filter( 'facetwp_facet_pager_link', function( $html ) {
    return str_replace( [ '<a', '/a>' ], [ '<span', '/span>' ], $html );
});

Where does code go?

PHP

PHP code usually starts with <?php  and can go into your child theme’s functions.php file.

JavaScript

If the code starts with <script>, then you can paste it into a wp_head PHP hook as shown in this example.

CSS

Add to your (child) theme’s style.css file.

© 2025 Gists - FacetWP • Built with GeneratePress