Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Page & Category Menu Bars »

[SOLVED] External links in new window


  #1  
Old Nov 5, 2009, 01:58 AM
Nickp
 
7 posts · Nov 2009
I have created a page menu bar which lists all the pages in the blog/site. I want to add a further item to the menu to link to an external site, and I want that link to open in a new window/tab.

I have created a page called "External" and I have modified functions.php to pick up the link to the "External" page and present "http://www.external.com" instead. This works just fine. How do I get this external link to open in a new window? Where do I go to add the "target=_blank"?

I have tried editing functions.php like this:
Quote:
<?php function replace_menu_link($string) {
return str_replace('\"http://mydomain/wordpress/external\"',
'\"http://www.external.com/\" target=_\"blank\"' , $string);
}
but this just loses the link altogether. (I may have escaped the quotes wrong though...)

I am happy for all external links on the menu to open in a new window/tab.

Other plugins I have tried:
* Redirector - means I don't have to edit functions.php and works ok; no new window though
* Identify external links - this works ok on the content of a post but doesn't pick up changes made by Redirector or code changes in functions.php

Is there a plugin that will work with Atahualpa, or do I need to dig further into the code in functions.php?

Sorry if there's a thread on this already, I thought I'd searched enough! Please point me to it if there is one!

Last edited by Nickp; Nov 5, 2009 at 03:21 AM. Reason: Solved
  #2  
Old Nov 5, 2009, 03:19 AM
Nickp
 
7 posts · Nov 2009
This plugin does the trick:
http://txfx.net/wordpress-plugins/page-links-to/

Bookmarks

Tags
external links, links, menu item, new window

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


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 02:59 PM
Open RSS in New Window? adum RSS, Feeds & Subscribing 6 Jan 12, 2010 06:19 PM
How to add External links to Home About menu fairpoint Atahualpa 3 Wordpress theme 4 Nov 5, 2009 01:34 PM
Make external links open in a new window clarge Header configuration & styling 1 Aug 9, 2009 03:00 PM
Opening links in a new window HalfWayThere Atahualpa 3 Wordpress theme 7 Apr 15, 2009 06:53 PM


All times are GMT -6. The time now is 09:18 PM.


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