Add icon to blogroll widget links

This snippet customizes the html output of the blogroll links widget. In this example we add an icon after the list tag so it appears left to every link

/**
 * Snippet Name: Add icon to blogroll widget links
 * Snippet URL: https://www.wpcustoms.net/snippets/add-icon-blogroll-widget-links/
 */
  function wpc_modify_blogroll_list( $args )
{
    $li_start = isset ( $args['before'] ) ? $args['before'] : '
  • ‘;
    $args[‘before’] = $li_start . ‘‘;
    return $args;
    }
    add_filter( ‘widget_links_args’, ‘wpc_modify_blogroll_list’ );

  • 0 0 vote
    Article Rating
    Subscribe
    Notify of
    guest
    0 Comments
    Inline Feedbacks
    View all comments
    0
    Would love your thoughts, please comment.x
    ()
    x