Home Forums WordPress Tech Help How to show shortcode in WordPress menu?

  • This topic has 1 reply, 2 voices, and was last updated 1 year ago by david.
Viewing 1 reply thread
  • Author
    Posts
    • #32060
      o3rge
      Keymaster

      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.

    • #32061
      david
      Participant

      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.

      • This reply was modified 1 year ago by david.
Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Close Search Window