• Resolved Rob Rusnak

    (@rrusnak)


    Hi,
    This is a great plugin I’ve been using for a long time. Many thanks to all the contributors!

    Is there an easy way, a filter perhaps, to add multiple icons/links for a single icon like facebook? For instance I have clients that have either multiple facebook business pages or a facebook page as well as facebook groups. So there would be multiple facebook icons each with unique URL links.

    Maybe the filter for adding additional icons can be used for this purpose? How would that work?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Nick C

    (@modernnerd)

    Hi Rob!

    There are a few separate options you could consider:

    1. Suggest that clients link to one Facebook URL only (to avoid confusion with multiple seemingly-identical Facebook icons appearing near each other).

    2. If clients insist on linking to multiple Facebook pages, consider adding a second widget with the other Facebook URL below the first one. You could optionally style the widgets to line up, or title the second widget to make it more clear which one points where.

    3. If you’d prefer two identical icons within one widget both pointing to Facebook, you can use a filter as you mentioned to create a second Facebook field (you will need to update ‘https://example.com’ with your own URL in the code):

    add_filter( 'simple_social_default_profiles', 'custom_add_facebook_icon' );
    function custom_add_facebook_icon( $profiles ) {
    	$profiles['facebook2'] = array(
    		'label'   => __( 'Facebook 2 URI', 'simple-social-icons' ),
    		'pattern' => '
    		<li class="ssi-facebook">
    		<a href="%s">
    		<svg role="img" class="social-facebook" aria-labelledby="social-facebook2-{WIDGET_INSTANCE_ID}">
    		<title id="social-facebook2-{WIDGET_INSTANCE_ID}">Facebook</title>
    		<use xlink:href="https://example.com/wp-content/plugins/simple-social-icons/symbol-defs.svg#social-facebook"></use>
    		</svg>
    		</a>
    		</li>',
    	);
    
    	return $profiles;
    }
    Thread Starter Rob Rusnak

    (@rrusnak)

    Hi Nick,
    Thanks for the great response.
    1) I know what you mean, I’m always trying to talk clients out of bad ideas, but it doesn’t always work ??
    2) I did not even think of that! Leaning towards this.
    3) I’ll try this as well, thanks so much for the code.

    Take care,
    Rob

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add multiple of one icon (facebook)’ is closed to new replies.