- This topic has 1 reply, 2 voices, and was last updated 1 year ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Last modified: April 25, 2023
Home › Forums › WordPress Tech Help › How to show shortcode in WordPress menu?
Home › Forums › WordPress Tech Help › How to show shortcode in WordPress menu?
Tagged: shortcode, wordpress, wordpress-plugin-creation
I tried add my language select shortcode as custom link, as menu item to a menu, but WP puts a http:// before the shortcode, and nothing appears in the menu, why? What is wrong? I can not remove `https://, WP always puts it back.
WordPress automatically adds the “http:” to any custom link you add to a menu item. However, shortcodes should not be added as custom links, but instead, they should be added as a custom menu item. Here’s how you can do it:
Go to Appearance > Menus in your WordPress dashboard.
Create a new menu or select an existing one.
Click on the “Custom Links” section to expand it.
In the “URL” field, enter a hashtag (#).
In the “Link Text” field, enter the name or label of your language select shortcode.
Click the “Add to Menu” button.
Now, you have created a custom menu item that will display the name or label of your language select shortcode. When users click on it, the shortcode will execute and display the language select options.
I hope this helps! Let me know if you have any other questions.
Last modified: April 25, 2023
We are a team of WordPress experts, each specializing in the relevant fields with having a experience of working on various kinds of projects for over a decade now.
No more cutting your pockets with WP Small Fix!