Social Sharing Icons in top bar not opening in new page
-
Mod
Not that I know of, but it is easy to achieve using a child theme.
In functions.php, find this line (it’s way down there, line# 2369, I think):
<a href="<?php echo $graphene_settings['twitter_url']; ?>"
title="<?php printf(esc_attr__('Follow %s on Twitter', 'graphene'),
get_bloginfo('name')); ?>" class="twitter_link">
<span><?php printf(esc_attr__('Follow %s on Twitter', 'graphene'),
get_bloginfo('name')); ?></span>
</a>and replace it with this one:
<a href="<?php echo $graphene_settings['twitter_url']; ?>"
title="<?php printf(esc_attr__('Follow %s on Twitter', 'graphene'),
get_bloginfo('name')); ?>" class="twitter_link" target="blank">
<span><?php printf(esc_attr__('Follow %s on Twitter', 'graphene'),
get_bloginfo('name')); ?></span>
</a>Notice what I’ve done here. I’ve added
target="blank"
inside the opening anchor tag, just before the<span>
that shows the Twitter icon. Addingtarget="blank"
causesthe link to open in a new window (or new tab, if you have that setting activated in your browser).
Now that you know that, you can change the Facebook one, as well.
Be sure to do this only in a child theme, or this setting will be lost when the theme is updated.
Have fun,
Ken
Hello Ken – Thanks for this post guys! I used this to fix my Twitter and Facebook, worked great! I installed a LinkedIn icon as well, can you tell me how where I need to place the (target=”blank”) for this one?
Here is the code right under the Facebook code, I am guessing this is it?:
/* Loop through the registered custom social modia */
$social_media = $graphene_settings['social_media'];
foreach ($social_media as $slug => $social_medium) : if (!empty($slug) && !empty($social_medium['url'])) : ?>
<?php /* translators: %1$s is the website's name, %2$s is the social media name */ ?>
<a>" title="<?php printf(esc_attr__('Visit %1$s's %2$s page', 'graphene'), get_bloginfo('name'), $social_medium['name']); ?>" class="<?php echo $slug?>-link" style="background-image:url(<?php echo $social_medium['icon']; ?>)"><span><?php printf(esc_attr__('Visit %1$s's %2$s page', 'graphene'), get_bloginfo('name'), $social_medium['name']); ?></span></a>
<?php endif; endforeach;
}
add_action('graphene_feed_icon', 'graphene_top_bar_social');Thank You,
Mark
AdminI’ve added the options to make links open in new window for the social sharing button on the top bar as well as for the Twitter widget. It will be available in the next update. You won’t need to edit the theme’s codes to achieve this anymore.
Hey thank you for the update and reply, Much appreciated!
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.