Social Sharing on Blog Posts - Instagram

Hi Themeco,

I’ve implemented this suggested code in my functions.php and it’s working great:

function x_add_social_sharing() {
if ( (!is_front_page() && is_home()) || is_single() ) {
echo do_shortcode(’[x_share title=“Share This Article” facebook=“true” twitter=“true” linkedin=“true” instagram=“true” ]’);
}
}
add_action(‘x_before_the_content_end’, ‘x_add_social_sharing’);

I am trying to add social sharing for Instagram, but can’t find a thread that talks about this and my attempt to include it above doesn’t seem to work. Can you help?

Thanks
Amanda

1 Like

Hello Amanda,

Thanks for writing in! Regretfully, Instagram is not included in the Social Share element shortcode. As of this moment, Instagram did not provide an api to allow to share a link to Instagram. You can add a link in your Instagram post to your blog post but not the other way around.

Hope this explains your issue briefly.

1 Like

Hi RueNel,

That context helps a lot. Thank you.

Another question, is it possible to position the social share above the blog post content, but below the headline?

Thanks,
Amanda

Hey Amanda,

To move the social share element above, simply replace your code with the following:

function x_add_social_sharing() {
	if ( (!is_front_page() && is_home()) || is_single() ) {
		echo do_shortcode('[x_share title="Share This Article" facebook="true" twitter="true" linkedin="true" instagram="true" ]');
	}
}
add_action('x_after_the_content_begin', 'x_add_social_sharing');

To learn more about Actions, Filters and Hooks in X and how to use them, please see https://theme.co/docs/actions-filters-and-hooks

Hope this helps!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.