opening header img link in new window
Truthfully I am uneducated in web languages however I have managed to link my header img to an external link. I want that link to open in a new window and can’t seem to figure out how to get it to do that
<div id="header" onclick="location.href='http://www.myURL.com/';" style="cursor: pointer;">
is the code I used to accomplish the linking of the image. I am lost as to how to get it to open a new windowMod
Apparently I am way out of my league here. The code I put in was from a wordpress forum post explaining what and where to put that line in order to link your header img.
I did it, and it works, but it won’t open it in a new tab or window. I have added the code
target="_blank";within it, after the href url and nothing happens. It still opens in the same window. I believe it is because of the location.href
Frankly, at this point I think I am asking; what do I need to add to get my banner to link to an external page, and for that link to be opened in another tab/page? And where do I need to add it?
Every google search I have done gives me div tags but I either get a php error when inserting them, or nothing happens. So at this point I am asking fresh, how what and where?ModQuote:what do I need to add to get my banner to link to an external page, and for that link to be opened in another tab/page?
Unfortunately, WordPress isn’t really designed to work this way. In fact, with most websites, clicking on a header image usually takes users back to the home page, so anything that’s different can throw them off.
That said, you can probably achieve this with a Graphene action hook widget area. You can create a
<div>in that widget with a link to wherever you want to go. Then style that link to have a transparent background (use a transparent .png) and then adjust the size and position to cover your header image.
A bit of work, but it should do what you want.
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.