Reputation: 135
How to add target "blank" to a link in Wordpress "functions.php". The link which opens in same window is:
<a href=\"".$widj_options['link']."\" class=\"btn-bg btn-bg-widget w-button\">".$widj_options['title']."</a>
For some reason adding the target blank before the href doesn't work:
<a target = '_blank' href=\"".$widj_options['link']."\" class=\"btn-bg btn-bg-widget w-button\">".$widj_options['title']."</a>
Upvotes: 2
Views: 1029
Reputation: 181
Try to add like that.
<a target ='_blank' href='<?=$widj_options['link']?>' class='btn-bg btn-bg-widget w-button'><?=$widj_options['title']?></a>
Upvotes: -1
Reputation: 804
Remove space target="_blank"
OR
You are doing it right, so we need to check for incompatibility issues. Please try with no extra plugins enabled (Only Toolset) and with a default WordPress theme.
Upvotes: 0
Reputation: 1908
Do something like this.
<a target='_blank' href='".$widj_options['link']." class='btn-bg btn-bg-widget w-button'>".$widj_options['title']."</a>
Upvotes: 1
Reputation: 78
please remove the space after target
<a target='_blank' href=\"".$widj_options['link']."\" class=\"btn-bg btn-bg-widget w-button\">".$widj_options['title']."</a>
Upvotes: 1