Last active
August 29, 2015 14:02
-
-
Save dimadin/e4445d21002ccdade530 to your computer and use it in GitHub Desktop.
WP Links Widgets Customizing
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 | |
/** | |
* Replace <ul> from blogroll widget with <div>. | |
*/ | |
function md_replace_ul_blogroll( $output ) { | |
$output = str_replace( "<ul class='xoxo blogroll'>", "<div>", $output ); | |
$output = str_replace( "</ul>", "</div>", $output ); | |
return $output; | |
} | |
add_filter( 'wp_list_bookmarks', 'md_replace_ul_blogroll' ); | |
/** | |
* Replace <li> from blogroll widget with <span>. | |
*/ | |
function md_replace_li_blogroll( $args ) { | |
$args['before'] = '<span>'; | |
$args['after'] = '</span>'; | |
return $args; | |
} | |
add_filter( 'widget_links_args', 'md_replace_li_blogroll' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment