Find Answers and Get Support › Forums › Cera – Intranet & Community Theme › Unsupported Plugins › Need to add target=_blank to External Links Permanently
- This topic has 4 replies, 2 voices, and was last updated 4 years, 2 months ago by
Manathan.
-
AuthorPosts
-
VarunParticipant@varunmahajan
- 1 Topics
- 2 Posts
Hi, I’m trying to add target=_blank and rel=nofollow to external links permanently excluding my subdomains.
I’ve external links posted in content and quiz answers on course pages and am using focus mode.
I tried using the plugin Wp External Links but it doesn’t work. Next, I tried using the below script, and it still doesn’t work. How can I solve this, please?
$(document).ready(function() { $("a[href^=http]").each(function(){ // NEW - excluded domains list var excludes = [ 'excludeddomain1.com', 'excludeddomain2.com', 'excluded.subdomain.com' ]; for(i=0; i<excludes.length; i++) { if(this.href.indexOf(excludes[i]) != -1) { return true; // continue each() with next link } } if(this.href.indexOf(location.hostname) == -1) { // attach a do-nothing event handler to ensure we can 'trigger' a click on this link $(this).click(function() { return true; }); $(this).attr({ target: "_blank", title: "Opens in a new window" }); $(this).click(); // trigger it } }) });
November 23, 2020 at 10:44 #26351@themodactyl- 0 Topics
- 6690 Posts
Hi @varunmahajan,
Thanks for buying our theme. We hope it will meet all your expectations! 🙂
We’ve received your request and we’ll get you an answer shortly.
We really thank you for your patience!
In the meantime, feel free to check out our documentation resources for more help:
Kind regards,
November 24, 2020 at 13:36 #26401@themodactyl- 0 Topics
- 6690 Posts
Hi @varunmahajan,
Thank you for your patience. 🙂
This is standard behavior with WordPress, I’m afraid.
As this is not breaking the website, changing this is considered customization work. Unfortunately, this is a service that we do not provide.
We only share snippet only to solve issues with our theme. Any further request for CSS snippets will have to be part of a defect that needs to be fixed urgently. No snippets will be shared otherwise.
If you want to go further with the customization of your website, we advise that you hire a freelancer to do it for you.
If you’re on a tight budget, we recommend you to require the services from Envato Studio freelancers (https://studio.envato.com/explore/websites-programming). This web platform gives you access to developers who have already experience with theme customizations, and for very competitive prices.
Thank you for your understanding.
November 25, 2020 at 15:50 #26475VarunParticipant@varunmahajan- 1 Topics
- 2 Posts
Hi Manathan,
I understand the standard WordPress behaviour which anyone can generally change with plugins. I’m trying to do the same. But its’s the LearnDash plugin which is not letting me run jQuery or other Javascript codes in the Focus mode. Then it has to be rectified from the LearnDash side.
Kindly do the needful.
November 25, 2020 at 16:42 #26482@themodactyl- 0 Topics
- 6690 Posts
Hi @varunmahajan,
Unfortunately, we have no clue. ?♂️
As this issue is related with LearnDash, it’s best if you try to reach the plugin authors. They will be more informed and better suited to help you.
To go further, we invite you to post your request on their support forums:
We remain available for all support requests related with the use of your theme.
Best,
November 26, 2020 at 17:22 #26532 -
AuthorPosts
Hi there,
This topic has been inactive for a while now so we will be closing it to keep the forum tidy. Don't hesitate to create a new topic if you still need help and we'll be glad to help you!
Best regards,
The Themosaurus team.
The topic ‘Need to add target=_blank to External Links Permanently’ is closed to new replies.