A manual tweak for icons in the Syndication Links plugin (BoffoSocko)
I'm not sure why I had never manually done the fix before, but I've had issues1 2 with the Syndication Links plugin showing icons for the reading.am service and my old chrisaldrich.wordpress

My gut was right 😃. You can add extra icons without editing the plugin, by adding something similar to this to your theme’s functions.php file:

function wp4632_extra_site_icons( $return, $url) {
	$sites = array(
		'chrisaldrich.wordpress.com' => 'wordpress',
		'www.reading.am' => 'book',
	);
	$parsed = parse_url( $url );
	$return = false;
	if ( false !== $parsed ) {
		$host = $parsed['host'];
		if ( array_key_exists( $host, $sites ) ) {
			$return = $sites[ $host ];
		}
	}
	return $return;
}
add_filter( 'syn_link_mapping', 'wp4632_extra_site_icons', 10, 2);

For maximum upgrade safety, I put modifications like this into a child theme.

Without similar code in my theme, this post doesn’t display the (test) Mastodon syndication link… but with it the link and icon are displayed. The $sites array can be modified with any URLs you want mapped to a suitable icon in the set.

Hope this helps you out!

One thought on “

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.