Below, you’ll find a detailed guide on how to add the Sliderby10Web 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 Sliderby10Web Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Sliderby10Web Plugin and the shortcodes it provides:
![Plugin Icon](https://ps.w.org/slider-wd/assets/icon-128x128.png?rev=2068748)
"Sliderby10Web is an advanced WordPress plugin that allows you to create stunning, responsive sliders. Utilize the slider-wd slug to enhance your site's visual appeal and user experience."
- [wds]
Sliderby10Web [wds] Shortcode
The Slider-WD shortcode is used to fetch and display images from a specified slider. It takes an ‘id’ as a parameter, which is the slider’s ID. The function checks if the ‘id’ is valid and greater than zero. If valid, it retrieves the images associated with that slider. It then loops through these images, adding only those hosted on the same site to an array. This ensures that only self-hosted images are included in the slider.
Shortcode: [wds]
Parameters
Here is a list of all possible wds shortcode parameters and attributes:
id
– Unique identifier for the slider images
Examples and Usage
Basic example – A simple way to utilize the slider-wd plugin shortcode to display a slider with a specific ID.
[wds id=2 /]
Advanced examples
Displaying multiple sliders by referencing their IDs. The sliders will load in the order of their IDs.
[wds id=2 /]
[wds id=3 /]
[wds id=4 /]
Using the shortcode to display a slider by referencing the ID and adding custom parameters. The slider will load with the specified parameters.
[wds id=2 param1=value1 param2=value2 /]
Please note that the ‘param1=value1’ and ‘param2=value2’ are placeholders for actual parameters you might want to use. Replace them with the actual parameter names and values you want to use.
PHP Function Code
In case you have difficulties debugging what causing issues with [wds]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('wds', array($this, 'shortcode'));
Shortcode PHP function:
function shortcode( $params = array() ) {
if ( is_array( $params ) ) {
$id = shortcode_atts(array('id' => WDW_S_Library::get('slider_id', 0)), $params);
$id = $id['id'];
}
else {
$id = $params;
}
if ( 0 < $id ) {
$images = $this->get_shortcode_images( $id );
foreach ( $images as $image ) {
// Include in sitemap self hosted images only.
if ( strpos($image, site_url()) !== FALSE ) {
$this->images[] = array(
'src' => $image,
'title' => '',
'alt' => ''
);
}
}
}
}
Code file location:
slider-wd/slider-wd/framework/WDW_S_Sitemap.php
Conclusion
Now that you’ve learned how to embed the Sliderby10Web 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.
Leave a Reply