How do I set to open links in new window?

Links open in same window taking user out of website. How can I set to open in new window?

    Nick

    Alternatively, you can set links to open in a new window manually by using the "target" attribute when you build your link. For instance, your link might look like:

    <a href="http://google.com" target="_blank">

    EDIT: If you are comfortable editing the plugin itself to do this automatically, you can follow these steps (assuming plugin version 1.5) - remember to always back everything up in case something fails along the way:

    1. Go to: wp-content/plugins/buddypress-activity-plus/lib/bpfb_group_documents.php
    2. Find the line 187: '<a href="' . bp_get_group_permalink($group) . '">' . bp_get_group_name($group) . '</a>'
    3. Change to: '<a href="' . bp_get_group_permalink($group) . '" target="_blank">' . bp_get_group_name($group) . '</a>'

    Nick

    Nick

    @Taye - Yep! If you're using a text editor, you can search the document for this comment: Creates the activity info message. - the code that's referenced in the previous post is in the function directly following this comment. I've taken a screenshot and highlighted the code for your reference.

    Let me know if you still can't find it.

    - Nick

    Patrick

    Hi again @Taye

    I took a look in images_tag_template.php and link_tag_template.php and, lo and behold, there is a constant referenced there that you can override to open external links in a new window.

    Simply add the following to your wp-config.php file:

    define('BPFB_LINKS_TARGET', true);

    I'm going to update the usage docs with this too... now that I know about it

    Taye

    Can you be more specific about where to add the code in the wp-config.php file? I don't know html code. Is this part of the plugin code? Will there be a plugin update coming? Diddling with the code makes me very nervous.

    Patrick

    @Taye

    The wp-config.php file is the same file you would have edited when you first installed WordPress on your site to add your database name, username and password.

    It is in your wp-content folder that you can access either via FTP or, if you use cPanel at your host, you can use the File Manager feature.

    You would need to open wp-config.php in a text editor (not a word processing program like MS Word as that adds formatting that would render the code useless, and likely mess up other things too).

    Add the code above just before the line that says
    "That's all, stop editing".

    Then save and re-upload the file.

JOIN 426730 HAPPY MEMBERS

We pride ourselves on our level of customer support and responsiveness to member requests. Your WordPress experience will never be the same


Start free trial


ABOUT SSL CERTIFICATES