External link for image not working in widget
-
Hi,
I’m trying to create an image in a text widget that links to an external page (http://waronwalls.com)
The code I typed is as follows:
<center><img src=”wp-content/uploads/2014/05/WOW-button.jpg”></center>
Instead of linking to the external page (http://waronwalls.com) it links to an error page on my site archaeoadventures.com. The link looks like: http://www.archaeoadventures.com/http://waronwalls.com
How do I get the external link to work for the img in the text box?
Thanks for the help!
Cheers,
Genevieve
-
In a text widget add this:
<a href="http://waronwalls.com/"><img src="http://waronwalls/wp-content/uploads/2014/05/WOW-button.jpg" height="number_here" width="number_here" /></a>Make sure to use an image of the size to fit in the widget area and to replace ‘number_here’ twice in above. Use CSS to center an image.
See:
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_imglink
The href attribute for the a tab should be
Also, you have an extra set of quotes at the end of the href attribute.
Actually, that is not right either, I used the wrong URL in the img src, use:
<a href="http://waronwalls.com/"><img src="http://www.archaeoadventures.com/wp-content/uploads/2014/05/WOW-button.jpg" height="number_here" width="number_here" /></a>Hi,
It still isn’t working. When I click on the button it tries to send me here:
http://www.archaeoadventures.com/”http:/waronwalls.com/”
It should be linking me to here: http://waronwalls.com
What I wrote in the text box is:
<center><img src=”http://www.archaeoadventures.com/wp-content/uploads/2014/05/IMG_4372.jpg”></center>
How do I make it actually link to http://waronwalls?
Thanks!
What I wrote in the text box is:
<center><img src=”http://www.archaeoadventures.com/wp-content/uploads/2014/05/IMG_4372.jpg”></center>
please re-read the above and actually add the code given.
Remove the extra “” in the
<a href=""http://waranwalls.com/"">
so it should be<a href="http://waranwalls.com/">Hey Guys,
So sorry about the earlier post. I did enter the code like had been suggested. I just copy and pasted it wrong in my comment. I was pretty knackered last night, wasn’t quite typing straight. 🙂
I re-entered to code as you recommended to enter it and I still get sent to the wrong link.
So the code I have in my text box is:
<img src=”http://www.archaeoadventures.com/wp-content/uploads/2014/05/WOW-button.jpg” height=”225″ width=”250″ />
And it still says takes me to an error page with the http address of:
http://www.archaeoadventures.com/”http:/waronwalls.com/”
Are there other things I need to do or do to the image so it actually goes to the link?
Thanks so much for all the help!!!!!
When I post the comment it changes my code.It removes the hyperlink part. So let me try something different.
In the text box I’m entering:
<a href="http://waronwalls.com/"><img src="http://www.archaeoadventures.com/wp-content/uploads/2014/05/WOW-button.jpg" height="225" width="250" /></a>But it’s not taken me to that link in the code.
Thanks for the help!!!!!!!!!!!!
When you post code here, you need to place it between ‘barticks’. On a standard keyboard, a bartick is all way to the left of the numbers at top row.
The code you last posted is correct. If it is not working, make sure to flush any server cache in use and to refresh the page in your browser. If you are using a mobile browser or tablet, you may have to clear the cache fully.
I cleared my cache and tried it from a different browser and I’m till getting an error page.
What it looks like it’s doing is adding the link of the page the widget is on in front of the link in the code. For example on the blog page it adds “http://www.archaeoadventures.com/blog” in front of the “http://waronwalls.com”
When I hover over the text widget image I get
`http://www.archaeoadventures.com/blog/”http://waronwalls.com/”
Instead of http://waronwalls.com
It’s doing it for all my text widget images that are links.
Could it be a problem in a CSS or PHP file. It’s never done this before until now.
Does this happen if your deactivate all plugin and switch to default unedited theme. A theme or plugin is the likely culprit.
Yep. I did both of those and it’s still doing it.
I figured it out!
I got rid of the ” around the link and it works now.
So the code now reads
`<img src=”http://www.archaeoadventures.com/wp-content/uploads/2014/05/WOW-button.jpg” height=”225″ width=”250″ />
And it works. Don’t ask me why, no clue. Just happy it works now. 🙂
Thanks for your patience and help with this!
<center><a href = http://www.archaeoadventures.com/travel-guides/><img src="http://www.archaeoadventures.com/wp-content/uploads/2014/06/middle-east-buton.jpg" height="225" width="250" /></a></center>
The topic ‘External link for image not working in widget’ is closed to new replies.