There are a few ways to swap out text headings with images in WordPress. The “Blogroll” heading is a bit tricky. However you can swap the term “Blogroll” by editing the bookmark-templates.php file included in the WordPress package.
* These steps assume the desired image name is dummy.gif
Step 1. – Upload your image to wp-content/themes/default/images/dummy.gif
Step 2. – Open the installed bookmark-templates.php file
Step 3. – Back up bookmark-templates.php with different name
(worse case scenario measure)
Step 4. – Find and edit the function named wp_list_bookmarks
Step 5. – Create a variable name $img and define it within the first line of the wp_list_bookmark function
Step 6. – Alter the defaults array replacing (“Blogrolls”) with ($img) and change the 1 to a 0, which is found next to ‘categorize’ in the default array
Step 7. – Save and upload the file. Double check that the image path is correct and also that any quotes in the path are escaped properly
When finished the default array should look something like this.
function wp_list_bookmarks($args = '') {
$img = "<img src=\"https://dummy.com/blog/wp-content/themes/default/images/dummy.gif\" alt=\"Swap Text for Image\"/>";
$defaults = array(
'orderby' => 'name', 'order' => 'ASC',
'limit' => -1, 'category' => '', 'exclude_category' => '',
'category_name' => '', 'hide_invisible' => 1,
'show_updated' => 0, 'echo' => 1,
'categorize' => 0, 'title_li' => __($img), //changed from 1
'title_before' => '<h2>', 'title_after' => '</h2>',
'category_orderby' => 'name', 'category_order' => 'ASC',
'class' => 'linkcat', 'category_before' => '<li id="%id" class="%class">','category_after' => ''
);
//LEAVE THE REST ALONE ...