Media Slider Shortcode

Below, you’ll find a detailed guide on how to add the Media Slider 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 Media Slider Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the Media Slider Plugin and the shortcodes it provides:

✩✩✩✩✩ () Active Installs: + Tested with: PHP Version:
Included Shortcodes:

Media Slider [MDSL] Shortcode

The ‘MDSL’ shortcode is part of the Media Slider Plugin in WordPress. It calls the ‘awl_media_slider_shortcode’ function which includes the ‘media-slider-code.php’ file. This file contains the code for the media slider output.

Shortcode: [MDSL]

Examples and Usage

Basic example – A shortcode for displaying a media slider using the post ID as a parameter.

[MDSL post_id=1 /]

Advanced examples

Displaying a media slider using the post ID and specifying the number of slides to display. Here, the shortcode will display the media slider for the post with ID 2 and will show a maximum of 5 slides.

[MDSL post_id=2 slides=5 /]

In this example, the media slider is displayed for the post with ID 3 and the slides are set to autoplay every 3 seconds.

[MDSL post_id=3 autoplay=3 /]

This example shows how to display a media slider for the post with ID 4 and disable the slide navigation controls.

[MDSL post_id=4 controls=false /]

Here, the media slider is displayed for the post with ID 5 and the slide transition effect is set to ‘fade’.

[MDSL post_id=5 effect='fade' /]

PHP Function Code

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

Shortcode line:

add_shortcode( 'MDSL', 'awl_media_slider_shortcode' );

Shortcode PHP function:

                    function awl_media_slider_shortcode( $post_id ) {
	ob_start();
	// output code file
	require 'media-slider-code.php';
	return ob_get_clean();
}
                    

Code file location:

media-slider/media-slider/shortcode.php

Conclusion

Now that you’ve learned how to embed the Media Slider 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 *