Notifications
Clear all

wpForo 1.x.x [Closed] url open in new tab

5 Posts
3 Users
0 Likes
584 Views
Posts: 25
Topic starter
(@pikapower)
Eminent Member
Joined: 4 years ago

Al the url's in our forum don't seem to open in a new tab.
Please advice what to do.

example url ==> https://www.yotpo.com/google-shopping-guide/

 

4 Replies
Sofy
Posts: 4308
 Sofy
Admin
(@sofy)
Support Team
Joined: 6 years ago

Hi @pikapower,

Put the following js code in your active theme JS files:

jQuery(document).ready(function(){jQuery("#wpforo #wpforo-wrap .wpforo-content a:not([href^=' https://wpforo.com '])").attr("target","_blank");});

Just change the red marked code and use your domain instead of the https://wpforo.com .

This article should be helpful for you:  https://www.collectiveray.com/add-javascript-to-wordpress

1 Reply
(@pikapower)
Joined: 4 years ago

Eminent Member
Posts: 25

@sofy

Thanks, but now also the topics opens in a new window....

Posts: 1602
(@anonymous20)
Noble Member
Joined: 8 years ago

Remove the above code and use this:

https://wordpress.org/plugins/wp-external-links/

 

Posts: 25
Topic starter
(@pikapower)
Eminent Member
Joined: 4 years ago

tried that and that works better, only embedded urls seems to open in same window

like this one:

https://www.askmathijs.com/e-commerce-events-2020/