Hello Enfold support,
Delema:
I am building a site for a financial investment consultant.
He has many posts on the new site I am building for him, as well as many posts on other financial news websites.
In order to have all his posts appear under his own “post category, I took the post title of the posts on external sites, created a post in the WP site I am building for him, that has the title, except, featured image, and using the Yoast plugin – a redirect to the other website.
The problem / question I have is : How – where can I set target=”_blank” to have it open in a new tab?
PLease see link to understand what I am referring to
Perhaps this code would do the trick. But where would I add it ? In functions.php? if yes, where in the file would I add it? Thank you
$(“a[href^=http]”).each(function(){
if(this.href.indexOf(location.hostname) == -1) {
$(this).attr({
target: “_blank”,
title: “Opens in a new window”
});
}
});
Hey!
Thank you for using Enfold.
You can try the solution provided in the following link. Adjust or change the selector: https://kriesi.at/support/topic/ajax-question/#post-465805
Regards,
Ismael