Shortcode in Menus Shortcode

Below, you’ll find a detailed guide on how to add the Shortcode in Menus Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Shortcode in Menus Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Shortcode in Menus Plugin and the shortcodes it provides:

Plugin Icon
Shortcode in Menus

"Shortcode in Menus is a handy WordPress plugin that allows you to add shortcodes into your website's menus effortlessly. It simplifies the process of customizing navigation bars for a personalized user experience."

★★★★☆ (79) Active Installs: 60000+ Tested with: 6.2.3 PHP Version: 5.6
Included Shortcodes:
  • [gs_test_shortcode]

Shortcode in Menus [gs_test_shortcode] Shortcode

The ‘gs_test_shortcode’ is a shortcode in the Shortcode-in-menus plugin. It’s designed to return a URL when called. This shortcode, when added to a menu, will display ‘https://wordpress.org’. It’s a simple yet effective tool for adding links to your WordPress menus.

Shortcode: [gs_test_shortcode]

Examples and Usage

Basic Example – The basic usage of the ‘gs_test_shortcode’ shortcode is to return a link to the WordPress.org website. This is done without any parameters or attributes.

[gs_test_shortcode /]

PHP Function Code

In case you have difficulties debugging what causing issues with [gs_test_shortcode] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'gs_test_shortcode', array( $this, 'shortcode' ) );

Shortcode PHP function:

function shortcode() {
			return __( 'https://wordpress.org', 'shortcode-in-menus' );
		}

Code file location:

shortcode-in-menus/shortcode-in-menus/includes/class-shortcode-in-menus.php

Conclusion

Now that you’ve learned how to embed the Shortcode in Menus Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *