Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Opening links in a new window


  #1  
Old Feb 18, 2009, 03:58 PM
HalfWayThere
 
25 posts · Feb 2009
Is there any way that I can force links in the body of a post to open in a new window (and possibly resized as well)?

Thanks in advance
  #2  
Old Feb 18, 2009, 04:20 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
Do you want to do this for all links automatically (and if so, for internal links inside your own site as well?), or selectively for specific links?

Selectively for specific links, without resizing, would be accomplished by adding (in HTML mode, in the WP editor) target="_blank" to the link

HTML Code:
<a href="http://www.otherdomain.com/" target="_blank">...</a>
Selectively, with resizing, replace the whole link with

HTML Code:
<a href="javascript:newwindow()">Click Here!</a>
and at Theme Options -> HTML/CSS Inserts -> CSS Insert add:
HTML Code:
 <script type="text/javascript">
<!--
function newwindow() {
window.open('http://wordpress.bytesforall.com/','something','width=300,height=200,resizable=yes');
}
//-->
</script>
Firefox will not obey to the size settings though, if it set to open links in a new tab instead of a new window.
  #3  
Old Feb 18, 2009, 08:15 PM
HalfWayThere
 
25 posts · Feb 2009
Quote:
Originally Posted by Flynn
Do you want to do this for all links automatically (and if so, for internal links inside your own site as well?), or selectively for specific links?
Thanks for the selective coding.

I was thinking of arranging things so that all links in the body of a post (other than internal links inside my own site [if that option is possible] would open in a new window (resized). Can this be done?

Thanks again
  #4  
Old Feb 19, 2009, 01:28 AM
js9600
 
29 posts · Dec 2008
Try Identify External Links - does not do much else and let you put a little "external" icon/symbol next to link. The other extension he link to has tons of icons to pick from.

Some dont like website to decide this, like against the rules!, so may be consider Open offsite links in new Windows You need to run the script and put tickbox at top of sidebar - or where ever. Then if user is unhappy about being sent offsite he/she can just untick box, which defaults to offsite.

You could use plugin only for getting neat external icon and let script take care of off/onsite.
  #5  
Old Feb 22, 2009, 01:10 PM
HalfWayThere
 
25 posts · Feb 2009
Hi

Thanks for the suggestions. I intend to try "Link Indication" plugin, as I think it could do what I want.

I'll update this post when I have tried it out.

Many thanks again.
  #6  
Old Feb 23, 2009, 03:27 PM
js9600
 
29 posts · Dec 2008
I noticed on/off-site script dont work with https adresses. But I think most http will direct to https if that is required so not a big problem. Just so you know if you want users to have enable/disable option.
  #7  
Old Apr 15, 2009, 06:24 PM
Whatsthatcat?
 
25 posts · Mar 2009
Uh-oh, I noticed the "with resizing" link doesn't work with Firefox. Any help? I need it to work there.
  #8  
Old Apr 15, 2009, 07:53 PM
Flynn's Avatar
Flynn
 
3,768 posts · Oct 2008
Munich, Germany
I updated the post above with a working solution.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening external links inside a Wordpress frameset? d_random Atahualpa 3 Wordpress theme 4 Dec 22, 2010 03:59 PM
Open RSS in New Window? adum RSS, Feeds & Subscribing 6 Jan 12, 2010 07:19 PM
Subscribe widget not opening in new window and won't center fredless Sidebars & Widgets 3 Jun 11, 2009 06:16 AM
Byline link opening in new window ronald73 Post-Kicker, -Byline & -Footer 2 May 6, 2009 02:55 AM
Allow comments on opening page. WaterfrontGazette Comments, trackbacks & pings 1 Dec 18, 2008 09:09 PM


All times are GMT -6. The time now is 05:47 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.