Snippets: Topbar Custom Image Icons

By default the topbar uses font icons for the social links. If you want you can easily use image icons instead. Simply go to the Customizer and change the style to Colored Image Icons (legacy) then you can use the snippet below to define your custom location for your images. In order for it to work your images must be png's and their names must match the "keys" defined in the 'wpex_topbar_social_options' array located in Total/framework/arrays.php. For example your twitter image must be twitter.php and your facebook icon must be facebook.png. To use other prefixes you would have to instead modify the file at partials/topbar/topbar-social.php via a child theme.

function my_alter_top_bar_social_img_url() {
	return get_stylesheet_directory_uri() .'/images/social/'; // Adjust accordingly.
add_filter( 'top_bar_social_img_url', 'my_alter_top_bar_social_img_url' );

Snippet Type: PHP

Posted Under: Top Bar

All PHP snippets should be added via a child theme's functions.php file.