Top menu custom links – New tab
-
Anyone know of a way to force top menu custom links to open in a new tab, perhaps via some additional CSS or other method?
Thanks an advance for any input!
The blog I need help with is: (visible only to logged in users)
-
When you’re adding a new page to a menu in the header, you should see the option to toggle that new link to “open in new tab”. You may have to remove one of the header links and then re-add it to the header manually in order to see that option pop up again.
If that doesn’t work, unfortunately there is no way to do this with CSS alone. But if you have a WordPress Pro plan, you can do this by using a plugin (such as Insert Headers and Footers) and adding some custom HTML code to include the following attribute to the HTML for your nav menu items:
target=”_blank”For example, the following code should enable your FAQ menu option to open in a new tab:
<a href="https://cygnusstudios.blog/faq/" target="_blank">FAQ</a>Hope this helps!
-
Hi there,
This is a setting you can enable for individual menu items when you set up your menu in the Customizer.
Go to Appearance ->Customize ->Menus and select the menu you’re editing. Click on the menu item you want to open in a new tab, and just check the box for that:
The option for this is built into WordPress, both in the Customizer for classic themes, and into the Navigation Block for block themes, so it doesn’t require any HTML, nor does it require a plugin.
If you’re not doing this yet, I recommend you set up a test site so you can check stuff like this before replying. You can then set your test site to the same theme a user has active, so you’ll see the same options they have available, enabling you to give the most accurate advice :)
-
Hi guys, and thanks for the replies! Just a few things up front that I should have included in my OP:
1) I’m currently using the “Lodestar” theme (BTW, most excellent, especially considering it’s a freebie).
2) What I’d like to do is to open new tabs
- only for menu navigation links to external sites
, not any pages or posts contained within my blog.
I want the latter to open in the same tab, which is what they all do at present.
3) I’m on a “Premium” plan, so no plugins for me. 😥
Sure hope that changes someday, at least on a limited basis. My site is non-profit, and I can’t afford to upgrade to a higher plan.
*******
I’m well familiar with HTML and the accompanying “target” options for hyperlinks, but there’s nowhere to add any of that in my navigation menu customization.
An “open in new tab” slider is indeed available to me in the Gutenberg editor when hyperlinking text,
- but not in the “Appearance>Customize>Menus” dialogs
. In fact, the screenshot posted by @kokkieh shows many options which aren’t, and never have been during the 5 years I’ve been using WordPress (with 4 different themes over that time period).
For comparison, here are a few screenshots of those dialogs as viewed on my account:
Edit “Page” menu entry; As mentioned above, I have no “open in new tab” requirement for these anyway:
https://drive.google.com/file/d/1INtb6yIMxmbTgL_9cCVSUfyVHn6cW_p9/view?usp=sharingNew “Custom Link”; The only options here are URL and “Link Text”:
https://drive.google.com/file/d/1IO3ECm7gT8qgknGTNW8zZ_xXfvf2SY6p/view?usp=sharingEdit “Custom Link”; Likewise, the only options are URL and “Navigation Label”:
https://drive.google.com/file/d/1IMz3HC0OVBQr9OuND1RZcNEhXWI_Lfzz/view?usp=sharingAll that said, my assumption at this point is, like plugins, those navigation menu options aren’t available on “Premium” plan accounts? If so, that’s the end of that.
Whew, long post… Hope I didn’t put you to sleep. Thanks again!
-
Sorry about the formatting in a few spots above, the “ul” option in this editor doesn’t seem to work.
-
Hey @cygnusstudiosflorida,
Not all is lost! The feature @kokkieh described is available to all users with any Plan – you just have to enable it from screen options under the advanced menu settings. Instructions on how to do so are here:
Appearance > Menu > Screen Options (tab at the top right) > and click the link target box
For full instructions, please visit our support page here:
https://wordpress.com/support/menus/advanced-menu-settings/#enable-advanced-menu-settings
Hope this helps!
-
@darnelldibble: BINGO… Exactly what I was looking for, and so simple!
I now see those other options must first be enabled as you’ve described. I selected them all, and now I’m in business for whatever menu item features I’d ever want to use.
The problem was they previously didn’t exist via “Appearance>Customize>Menus”, but after configuring the above they do now, so I can go either route.
This is something that wasn’t a huge deal, but has been bugging me for a long time and I wanted to finally address it since I just got done going to a new theme. Thank you for your time, VERY much appreciated! 💯
- The topic ‘Top menu custom links – New tab’ is closed to new replies.