WORDPRESS Open External link in iframe?

korfx04

Junior Member
Joined
Feb 27, 2009
Messages
153
Reaction score
97
I'm trying to figure out how to open external links so it will show a small div at the top of the page with my logo and such and the external website under that. Much like how adfly does it. I know people use to do this with iframes, but isn't iframes obsolete?
 
nope. Lots of people are doing that just like you described.
 
iframes is the way bro. What makes you think iframes are obsolete?
 
Can this be done with wordpress though? like when the end-user clicks the title to the article on index.php, it then will open the link clicked in a new tab or out.php in a iframe?
 
Last edited:
You can modify the word press themes however you like in the editor as you can modify the source code...

Putting in an iframe should be relatively simple. If you want to open up a new tab on the title, just do something like...

<a class='my_title' href='/your/site/here' target='_blank'><h1>This is my title<h1></a>

Alternatively, if you wanted it to render in an iframe, ideally you'd have the iframe at in the page already like:

<iframe src='/link/to/site' id='my_iframe'></iframe>

Then, on your title, you can attach a jQuery / JavaScript event listener on it to render the iframe with new content on click. You'll have to double check as i'm doing this off of memory, but something like this.

<script>
$('.my_title').click(function(){
iframe = $("#my_iframe").src = 'your_new_site';
})
</script>

Something like that. Hope this helps!
 
You can modify the word press themes however you like in the editor as you can modify the source code...

Putting in an iframe should be relatively simple. If you want to open up a new tab on the title, just do something like...

<a class='my_title' href='/your/site/here' target='_blank'><h1>This is my title<h1></a>

Alternatively, if you wanted it to render in an iframe, ideally you'd have the iframe at in the page already like:

<iframe src='/link/to/site' id='my_iframe'></iframe>

Then, on your title, you can attach a jQuery / JavaScript event listener on it to render the iframe with new content on click. You'll have to double check as i'm doing this off of memory, but something like this.

<script>
$('.my_title').click(function(){
iframe = $("#my_iframe").src = 'your_new_site';
})
</script>

Something like that. Hope this helps!

Thanks archert22, i will give that a try. I'm still open to suggestions on the best way to do this.
 
in some way yes iframe is not good aproach because browser will limit it a lot with security and you will not be able to communicate with it via javascript, better one is using CSS styles with floating DIV
 
Back
Top