Graphene Themes Forum

Graphene Themes Forum

Community support for Graphene themes

  • Home
  • Register
    • Reset password
  • Contact Us

Home › Forums › Graphene WordPress theme › Support

Social Sharing Icons in top bar not opening in new page

  • jamilla

    July 22, 2011 at 3:11 am #1402

    Hi Guys,

    Just wondering if there’s a setting that allows the social sharing icons and RSS that are on the top page to open in a new window.

    I notice when clicking on them they open in the current window.

    Ta

    Jami

    Mod

    Kenneth John Odle

    July 22, 2011 at 7:23 pm #15522

    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. Adding target="blank" causes

    the 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

    jamilla

    July 22, 2011 at 11:02 pm #15523

    Thanks Ken! 🙂

    Anonymous

    July 30, 2011 at 3:41 am #15525

    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

    Admin

    Syahir Hakim

    July 30, 2011 at 8:42 pm #15526

    I’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.

    Anonymous

    August 1, 2011 at 2:23 am #15527

    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.
Log In

Account

Log In
Register Lost Password

Search Forums

Priority Support

This free Support Forum relies on contributions from our support staffs and fellow Graphene themes users. While we endeavour to provide adequate and timely support, due to its voluntary nature responses are not guaranteed and may be delayed.

If you require urgent assistance, you may like to consider our Priority Support option.

Get Priority Support

Forums

  • Graphene WordPress theme
  • Graphene Mobile
  • Graphene Mobile Neo
  • Franz Josef

Recent Topics

  • The photo of my article is loading in the banner??
    12 months ago
  • need the original standard right sidebar back
    1 year ago
  • Hiding Child Listings only on Specific Pages?
    1 year ago
  • Is it possible to move the Comments counter?
    1 year ago
  • Image Size on Slider in home page
    1 year ago

Made with by Graphene Themes.