I’ve got a client with a custom nav menu link pointing to a third-party service. He wanted that custom link to open in a new tab, and I realized I didn’t know how to do it.
Fortunately, opening a menu link in a new tab is easy, and it’s available in WordPress core—no plugins or custom code required. The linked article gives a perfect visual guide to it.
The solution is interesting for a couple of reasons:
- It’s another of many examples where something perfectly easy is hidden thanks to the “Screen Options” interface.
- It’s an example where something useful is available through the backend Menu interface, but not the Customizer menu interface.
As a last thought: in my understanding, hardcoding “open this link in a new tab” is not great for UI/UX generally, since you’re making a decision for the user—proliferate tabs—that she should either be able to make herself (if she knows her browser), or that she may not want made. It’s a gray area, but just saying, don’t go crazy.
Image credit: Yandle
Keep reading the article at WPShout. The article was originally written by Fred Meyer on 2020-02-12 13:05:31.
The article was hand-picked and curated for you by the Editorial Team of WP Archives.
This article was written by Fred Meyer and originally published on WPShout.