HTML code to open link in new tab


#1

Hey,

thought I’d try here as I get little response over at the WPTITANS forum.

I don’t know if it’s theme specific, but I am finding it impossible to use the classic HTML code for a new tab ( )to open in my sidebar widgets (like a 300 x 250 ad space) and also in the slider images which link to other urls. It just won’t recognize the code and when you click on it it won’t go anywhere.

Is there a slightly different code to be used in other instances than a text link?

Appreciate any help or direction on this.

Jenna


#2
YOURSITE 

#3

Hey organic bee,

thanks for your response. What you write is what is used for a textual link, and I did try that. I am trying to find out why this code will not work when I type it into the slots for an ad link. For instance, in a widget area for a banner ad, you’ve got a couple of slots:

image url _____________________________
and then image link______________________________ (this is obviously where you want the person to go when they click on the ad)

when I put the code you suggested into that slot, it simply won’t work.

Same goes for the images in the main homepage slider. You have:

image url__________________________________
image link___________________________________

but , nope, the code won’t work. it not only doesn’t open in a new tab, but this classic code actually breaks the link and it simply stays on the homepage when you click.

Am I being clear? Is there a certain type of code you need to use when it is NOT a text link, but it is a slot within a widget or slider image?

Thanks for your help

Jenna


#4
 

#5

I think the problem might be that you’re trying to put the actual HTML for the link into the widget. Usually those widgets need two things: The URL to the image, so it can be displayed, and the URL that the image should link to.

If yours is different then apologies, but I suspect you’re just supposed to put the target URL in there and leave the HTML out, meaning you can’t add a target="_blank" from the widget admin. It’s probably fairly easy to edit the widget code itself though, if you’re wanting all your ads in that widget to open in new tabs.


#6
MichelleDancer said

I think the problem might be that you’re trying to put the actual HTML for the link into the widget. Usually those widgets need two things: The URL to the image, so it can be displayed, and the URL that the image should link to.

If yours is different then apologies, but I suspect you’re just supposed to put the target URL in there and leave the HTML out, meaning you can’t add a target="_blank" from the widget admin.
It’s probably fairly easy to edit the widget code itself though, if you’re wanting all your ads in that widget to open in new tabs.

Hi Michelle,

Thanks for your reply. for my widget problem, I actually just used a text widget and did the code Organic Bee had suggested up top, and that works great. But, yes, I am still having the same issue with the slider images that will not accept HTML code in their slots. Do you have any idea what that code edit would look like?

Thanks much,

Jenna


#7
phogzzz said
MichelleDancer said

I think the problem might be that you’re trying to put the actual HTML for the link into the widget. Usually those widgets need two things: The URL to the image, so it can be displayed, and the URL that the image should link to.

If yours is different then apologies, but I suspect you’re just supposed to put the target URL in there and leave the HTML out, meaning you can’t add a target="_blank" from the widget admin.
It’s probably fairly easy to edit the widget code itself though, if you’re wanting all your ads in that widget to open in new tabs.

Hi Michelle,

Thanks for your reply. for my widget problem, I actually just used a text widget and did the code Organic Bee had suggested up top, and that works great. But, yes, I am still having the same issue with the slider images that will not accept HTML code in their slots. Do you have any idea what that code edit would look like?

Thanks much,

Jenna

without seeing the code the authors uses for the slider(please don’t post it) we wouldn’t be able to tell you what exactly to change.

If you contact the author from their profile page, or in the comments section of the items(the page where you bought the theme) they should be able to tell you exactly what you need to change

~Chris


#8

Hi, thanks. I’ve tried but they’re not answering. Kind of frustrating actually. But i thank you both for your responses.