Side Menu Lite Shortcode

Below, you’ll find a detailed guide on how to add the Side Menu Lite – add sticky fixed buttons 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 Side Menu Lite – add sticky fixed buttons Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Side Menu Lite – add sticky fixed buttons Plugin and the shortcodes it provides:

Plugin Icon
Side Menu Lite – add sticky fixed buttons

"Side Menu Lite is a dynamic WordPress plugin that enables you to add sticky fixed buttons to your website. It's perfect for easy navigation and a seamless user experience."

★★★★✩ (8) Active Installs: 5000+ Tested with: 6.3.2 PHP Version: 5.6
Included Shortcodes:
  • [side-menu-lite]

Side Menu Lite [side-menu-lite] Shortcode

The Side-Menu-Lite plugin shortcode fetches and displays specific menu data. It extracts the ‘id’ attribute from the shortcode, queries the database for the corresponding menu, and checks its availability. If the menu exists and passes the check, it includes the associated style and script files, and returns the menu for display.

Shortcode: [side-menu-lite]

Parameters

Here is a list of all possible side-menu-lite shortcode parameters and attributes:

  • id – Unique identifier for the specific menu to display

Examples and Usage

Basic example – Utilizes the shortcode to display a table with the ID of 1.

[side-menu-lite id=1 /]

Advanced examples

Example 1: The shortcode is used to display a table with an ID of 2. If the table with the ID of 2 is not found, it will attempt to display a table with the ID of 3.

[side-menu-lite id=2 id=3 /]

Example 2: The shortcode is used to display three different tables with the IDs of 1, 2, and 3, respectively. If a table with a specific ID is not found, the shortcode will continue to the next ID.

[side-menu-lite id=1 id=2 id=3 /]

PHP Function Code

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

Shortcode line:

add_shortcode( $this->plugin['shortcode'], array( $this, 'shortcode' ) );

Shortcode PHP function:

function shortcode( $atts ) {
		extract( shortcode_atts( array( 'id' => "" ), $atts ) );
		global $wpdb;
		$id     = absint( $atts['id'] );
		$table  = $wpdb->prefix . 'wow_' . $this->plugin['prefix'];
		$sSQL   = $wpdb->prepare( "select * from $table WHERE id = %d", $id );
		$result = $wpdb->get_results( $sSQL, 'OBJECT_K' );

		if ( empty( $result ) ) {
			return false;
		}

		$param = unserialize( $result[ $id ]->param );
		$check = $this->check( $param, $id );

		if ( $check === false ) {
			return false;
		}
		$menu = '';
		include( 'partials/public.php' );
		$this->include_style_script( $param, $id );

		return $menu;
	}

Code file location:

side-menu-lite/side-menu-lite/public/class-public.php

Conclusion

Now that you’ve learned how to embed the Side Menu Lite – add sticky fixed buttons 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 *