Skip to:
Content
Pages
Categories
Search
Top
Bottom

External links in activity stream

  • @mrky007

    Participant

    Is there a way to setup the following features in Buddypress:

    1. Open internal links (posts, images) in same tab
    2. Open external links in new tab / window?

    This would be a very useful feature for everyone I think, but I can’t find a way to set it up.

Viewing 1 replies (of 1 total)
  • @slaffik

    Moderator

    The easiest solution is to use JavaScript here.

    Based on this: https://css-tricks.com/snippets/jquery/target-only-external-links/
    You can do like this:

    jQuery(document).ready(function(){
    jQuery('#activity-stream a').filter(function() {
       return this.hostname && this.hostname !== location.hostname;
    }).attr("target", "_blank");
    });

    You should add this to js file of your theme of plugin.

Viewing 1 replies (of 1 total)
  • The topic ‘External links in activity stream’ is closed to new replies.
Skip to toolbar