WordPress.org

Ready to get started?Download WordPress

Forums

Skirmish
Menu Pages Open in New Window (2 posts)

  1. dothistoday
    Member
    Posted 1 year ago #

    In the Skirmish Theme is there a way to make it so that when people click on a tab in the menu that page opens in a new window?

  2. dains
    Member
    Posted 11 months ago #

    Hi, that's actually a very common and easy Javascript function. You can find the code by starting a post and using the link inserter on the toolbar. You'll get a panel with the option "open in new window". Go ahead and finish the link, then switch to HTML view on the editor and you'll see the code you need.

    Now the fun part - you need to edit whichever PHP file is displaying the links and insert that code so it's put in when the menu creates the links. This ... isn't easy, because Javascript has a lot of characters that need to be escaped so the PHP won't choke on it.

    I'm sorry I can't help more, but that's the basics of how to go about it. II barely managed to get my own implementation working and that's specific to my particular theme, so copy/paste won't work for you. I hope someone can kick in with a simpler method, like a Javascript function that you can call from the PHP creating the menu. I'm not good enough in Javascript to do that :(

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.