AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Closed] Links to open in new tab

10 Posts
5 Users
2 Reactions
2,127 Views
StocksForum
Posts: 135
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@stocksforum)
Estimable Member
Joined: 8 years ago
[#8924]

How can I make links open in a new tab rather than in the current window which then takes me out of the forum?

The links in here for example:

https://smallcaps.com.au/forum/technology/emerge-gaming-to-develop-nickelodeon-esports-gaming-platform/


9 Replies
Sofy
Posts: 5774
 Sofy
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sofy)
Support Team
Joined: 8 years ago

Hi @stocksforum,

try the following js code. Add it in your theme js files:

jQuery(".wpforo-post-content a").attr('target' ,'_blank');

4 Replies
StocksForum
(@stocksforum)
Joined: 8 years ago

Estimable Member
Posts: 135
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Ok, can it be added in the future wpForo update?
Seems logical, otherwise people are taken away from the forum and may not return.


Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5774
Sofy
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

We'll take this into consideration for future updates.  


(@hector)
Joined: 7 years ago

Estimable Member
Posts: 108
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Posted by: @sofy

Hi @stocksforum,

try the following js code. Add it in your theme js files:

jQuery(".wpforo-post-content a").attr('target' ,'_blank');

Exactly in which file and where do I have to put that JavaScript code?

 


Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5774
Sofy
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@hector,

I'd suggest you read this article: https://www.collectiveray.com/add-javascript-to-wordpress


VereK
Posts: 522
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@verek)
Honorable Member
Joined: 8 years ago

Aside from the code above, if links are pasted as plain text (control+shift+v) it will auto add the target_blank functions.

Straight paste: https://wpforo.com/community/how-to-and-troubleshooting-2/links-to-open-in-new-tab/#post-27897

Plain text paste: https://wpforo.com/community/how-to-and-troubleshooting-2/links-to-open-in-new-tab/#post-27897


3 Replies
StocksForum
(@stocksforum)
Joined: 8 years ago

Estimable Member
Posts: 135
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

Thanks.

However need it to operate universally to open in new tab.

As users of the forum just want it to be simple to use and I want to make sure they stay in the forum when clicking a link, not ending up on another site.


(@anonymous20)
Joined: 10 years ago

Noble Member
Posts: 1593
VereK
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
Posted by: StocksForum

Thanks.

However need it to operate universally to open in new tab.

As users of the forum just want it to be simple to use and I want to make sure they stay in the forum when clicking a link, not ending up on another site.

Why don't you try a Wordpress plugin for that. There are plenty.


StocksForum
(@stocksforum)
Joined: 8 years ago

Estimable Member
Posts: 135
StocksForum
VereK
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

No thanks. I run a news site with many other features in it, the forum is just a part of it, most of the links are internal and open in the window.
Also adding plugins can slow the site and cause conflicts, plus security issues.

Links in the forum, especially if they are an external url, should open in a new tab logically. Thus keeping people in the forum.


Share: