Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WP Links Widgets Customizing
<?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
You can’t perform that action at this time.