WordPress.org

Ready to get started?Download WordPress

Forums

Menu link to outside source: target="blank" (5 posts)

  1. adunate
    Member
    Posted 2 years ago #

    I'm using Twenty Ten and easily created a menu with custom links (thanks Twenty Ten). However, one of my links is to a site outside the WP blog and I'd like it to open in a separate page. Where do I include the target="blank" code?

  2. Xam 1.0
    Member
    Posted 2 years ago #

    At the end of the url like this:

    <a href="http://wordpress.org/" target="_blank">Cool Link Here</a>
  3. adunate
    Member
    Posted 2 years ago #

    Thanks. Got that. But where does this go?

    I tried putting the target code in the custom menu section (Appearance/Menu/"my own custom menu"/, however, this isn't done as code?

    What php file can I find the menu text and then add the code?

    Thanks.

  4. Xam 1.0
    Member
    Posted 2 years ago #

    I assume you want the link in the top-navigation? Then you can put the code in the header.php something like this: http://pastebin.com/vrGqhQ1N

    You can also use this plugin to open all external links in a new window:

    http://wordpress.org/extend/plugins/open-external-links-in-a-new-window/

  5. adunate
    Member
    Posted 2 years ago #

    Thanks, installed the plugin. It works like a charm!

Topic Closed

This topic has been closed to new replies.

About this Topic