Last active
August 29, 2015 14:05
-
-
Save yoren/8f8b0fb54a9956016182 to your computer and use it in GitHub Desktop.
Add icons to wp_list_categories
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 | |
function my_list_categories( $output, $args ) { | |
$pattern = '/(<a.*?>)/'; | |
$replacement = '$1<i class="ico-my"></i> '; | |
return preg_replace( $pattern, $replacement, $output ); | |
} | |
add_filter( 'wp_list_categories', 'my_list_categories', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment