Below, you’ll find a detailed guide on how to add the Slider Hero with Animation, Video Background Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Slider Hero with Animation, Video Background Plugin shortcodes not to show or not to work correctly.
Before starting, here is an overview of the Slider Hero with Animation, Video Background Plugin and the shortcodes it provides:

"Slider Hero with Animation, Video Background is a versatile WordPress plugin that allows you to create stunning sliders with animated elements and video backgrounds. It enhances your website's interactivity and visual appeal."
- [hero-button]
- [qcld_hero]
[hero-button] Shortcode
The Slider Hero plugin shortcode is a powerful tool that allows you to customize button styles on your WordPress site. It lets you modify various attributes such as button color, border, font size, letter spacing, and more. The plugin also offers a range of button effects including glitch, fill, spin, shiney, 3D, and exborder. These effects can add a dynamic and interactive element to your site, enhancing user experience.
Shortcode: [hero-button]
Parameters
Here is a list of all possible hero-button shortcode parameters and attributes:
id
– Unique identifier for the specific slidertype
– Defines the type of button (1 or 2) to display
Examples and Usage
Basic example – The following shortcode will display a button with the default settings, by referencing the button’s ID.
[hero-button id=1 /]
Advanced examples
Using the shortcode to display a button by referencing both ID and type. The button will first try to load by ID, but if not found, it will try to load by type.
[hero-button id=1 type=2 /]
Using the shortcode to display a button by only referencing the type. This will load the first button that matches the type.
[hero-button type=2 /]
Using the shortcode with no parameters. This will load the first button found in the database.
[hero-button /]
Please note that the actual output will depend on the button settings defined in the database.
PHP Function Code
In case you have difficulties debugging what causing issues with [hero-button]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode('hero-button', 'qcld_slider_hero_shortcode');
Shortcode PHP function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | function qcld_slider_hero_shortcode( $atts = array ()){ ob_start(); global $wpdb ; extract( shortcode_atts( array ( 'type' => 1, 'id' => 1 ), $atts )); if ( $id != '' ){ $id = sanitize_text_field( $id ); $type = sanitize_text_field( $type ); $table = QCLD_TABLE_SLIDES; $slides = @ $wpdb ->get_results( $wpdb ->prepare( "SELECT * FROM $table WHERE id = %d order by ordering desc" , $id ) ); $btn = json_decode(wp_unslash(htmlspecialchars_decode( $slides [0]->btn))); $btn2 = json_decode(wp_unslash(htmlspecialchars_decode( $slides [0]->btn2))); if ( $type == '1' && $btn ->hero_button_shortcode== '1' ){ ?> <style type= "text/css" > .slider_hero_btn_cls_one{ <?php if ( $btn ->button_border== 'square' ) : ?> border-radius: 0px; <?php else : ?> border-radius: 35px 35px; <?php endif ?> <?php if ( $btn ->button_style== 'full_background' ) : ?> background: <?php echo esc_attr( $btn ->button_background_color); ?>; <?php else : ?> background: none; <?php endif ; ?> border: 2px solid <?php echo esc_attr( $btn ->button_background_color); ?> !important; padding: 12px 20px; box-sizing: content-box; <?php if (isset( $btn ->button_font_size) && $btn ->button_font_size!= '' ): ?> font-size: <?php echo esc_attr( $btn ->button_font_size ); ?> !important; <?php else : ?> font-size: 16px; <?php endif ; ?> <?php if (isset( $btn ->button_letter_spacing) && $btn ->button_letter_spacing!= '' ): ?> letter-spacing: <?php echo esc_attr( $btn ->button_letter_spacing ); ?> !important; <?php endif ; ?> <?php if (isset( $btn ->button_font_weight) && $btn ->button_font_weight!= '' ): ?> font-weight: <?php echo esc_attr( $btn ->button_font_weight ); ?> !important; <?php endif ; ?> text-decoration: none; min-width:100px; color: <?php echo esc_attr( $btn ->button_color); ?> !important; margin-right: 10px; text-shadow: none; display: -webkit-inline-flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; -webkit-box-pack: center; -webkit-flex-pack: center; -webkit-justify-content: center; -webkit-flex-align: center; -webkit-align-items: center; vertical-align: middle; } .slider_hero_btn_cls_one:hover{ <?php if ( $btn ->button_hover_color!= '' ) : ?> color:<?php echo esc_attr( $btn ->button_hover_color); ?>!important; <?php endif ; ?> <?php if ( $btn ->button_background_hover_color!= '' ): ?> <?php if ( $btn ->button_style== 'full_background' ): ?> background: <?php echo esc_attr( $btn ->button_background_hover_color); ?>; <?php else : ?> background: none; <?php endif ; ?> border: 2px solid <?php echo esc_attr( $btn ->button_background_hover_color); ?> !important; <?php endif ; ?> text-shadow: none; } </style> <?php //Button 1 Glitch Effect // if (isset( $btn ->button_effect) and $btn ->button_effect== 'glitch' ): ?> <style type= "text/css" > .shero_glitch_button > a:link{ color: <?php echo esc_attr( $btn ->button_color); ?> !important; } .shero_glitch_button > a:hover{ color: <?php echo esc_attr( $btn ->button_hover_color); ?>!important; } </style> <label for = "switch" class = "shero_glitch_button slider_hero_btn_cls_one" ><a href= "<?php echo esc_url($btn->button_url); ?>" target= "<?php echo esc_attr($btn->button_target); ?>" class = "" ><?php echo esc_attr( $btn ->button_text); ?></a></label> <?php // Area for Animated Fill Effect elseif (isset( $btn ->button_effect) and $btn ->button_effect== 'fill' ): ?> <style type= "text/css" > .hero_btn1_fill { color: <?php echo esc_attr( $btn ->button_color); ?> !important; border: 2px solid <?php echo esc_attr( $btn ->button_background_color); ?> !important; <?php if ( $btn ->button_border== 'square' ) : ?> border-radius: 0px; <?php else : ?> border-radius: 35px 35px; <?php endif ?> text-shadow: none; <?php if (isset( $btn ->button_font_size) && $btn ->button_font_size!= '' ): ?> font-size: <?php echo esc_attr( $btn ->button_font_size ); ?> !important; <?php else : ?> font-size: 16px; <?php endif ; ?> <?php if (isset( $btn ->button_letter_spacing) && $btn ->button_letter_spacing!= '' ): ?> letter-spacing: <?php echo esc_attr( $btn ->button_letter_spacing ); ?> !important; <?php endif ; ?> <?php if (isset( $btn ->button_font_weight) && $btn ->button_font_weight!= '' ): ?> font-weight: <?php echo esc_attr( $btn ->button_font_weight ); ?> !important; <?php endif ; ?> margin-right: 10px; } .hero_btn1_fill:before { background: <?php echo esc_attr( $btn ->button_background_color); ?>; } .hero_btn1_fill:hover { <?php if ( $btn ->button_hover_color!= '' ) : ?> color:<?php echo esc_attr( $btn ->button_hover_color); ?> !important; <?php endif ; ?> } </style> <a href= "<?php echo esc_url($btn->button_url); ?>" target= "<?php echo esc_attr($btn->button_target); ?>" class = "hero_btn hero_btn--border hero_btn--primary hero_btn--animated hero_btn1_fill" ><?php echo esc_attr( $btn ->button_text); ?></a> <?php // Area for Spin Effect elseif (isset( $btn ->button_effect) and $btn ->button_effect== 'spin' ): ?> <a href= "<?php echo esc_url($btn->button_url); ?>" target= "<?php echo esc_attr($btn->button_target); ?>" ><div class = "hero_spinner_tag slider_hero_btn_cls_one" data-content- default = "<?php echo esc_attr($btn->button_text); ?>" data-content-spinning= "<?php echo esc_attr($btn->button_text); ?>" ></div></a> <?php // Area for Shiney Effect elseif (isset( $btn ->button_effect) and $btn ->button_effect== 'shiney' ): ?> <a href= "<?php echo esc_url($btn->button_url); ?>" target= "<?php echo esc_attr($btn->button_target); ?>" class = "slider_hero_btn_cls_one hero_shiney_effect" ><?php echo esc_attr( $btn ->button_text); ?></a> <?php // Area for 3D Effect elseif (isset( $btn ->button_effect) and $btn ->button_effect== '3d' ): ?> <style type= "text/css" > .hero_btn1_3d { color: <?php echo esc_attr( $btn ->button_color); ?>; background: #fff; border: 5px solid <?php echo esc_attr( $btn ->button_background_color); ?> !important; color: <?php echo esc_attr( $btn ->button_background_color); ?> !important; padding: 12px 20px; text-shadow: none; <?php if (isset( $btn ->button_font_size) && $btn ->button_font_size!= '' ): ?> font-size: <?php echo esc_attr( $btn ->button_font_size ); ?> !important; <?php else : ?> font-size: 16px; <?php endif ; ?> <?php if (isset( $btn ->button_letter_spacing) && $btn ->button_letter_spacing!= '' ): ?> letter-spacing: <?php echo esc_attr( $btn ->button_letter_spacing ); ?> !important; <?php endif ; ?> <?php if (isset( $btn ->button_font_weight) && $btn ->button_font_weight!= '' ): ?> font-weight: <?php echo esc_attr( $btn ->button_font_weight ); ?> !important; <?php endif ; ?> margin-right: 10px; } .hero_btn1_3d:before{ background: <?php echo esc_attr( $btn ->button_background_color); ?>; } .hero_btn1_3d:after{ background: <?php echo esc_attr( $btn ->button_background_color); ?>; } .hero_btn1_3d:hover{ background: <?php echo esc_attr( $btn ->button_background_color); ?>; <?php if ( $btn ->button_hover_color!= '' ) : ?> color:<?php echo esc_attr( $btn ->button_hover_color); ?>!important; <?php endif ; ?> } </style> <a href= "<?php echo esc_url($btn->button_url); ?>" target= "<?php echo esc_attr($btn->button_target); ?>" class = "hero_3d_button hero_btn1_3d" ><?php echo esc_attr( $btn ->button_text); ?></a> <?php // Area for Expending Border Effect elseif (isset( $btn ->button_effect) and $btn ->button_effect== 'exborder' ): ?> <style type= "text/css" > .hero_btn1_exborder { color: <?php echo esc_attr( $btn ->button_color); ?> !important; background-color: <?php echo esc_attr( $btn ->button_background_color); ?>; border: 5px solid <?php echo esc_attr( $btn ->button_background_color); ?> !important; text-decoration: none; min-width:100px; padding: 12px 20px; margin-right:10px; <?php if (isset( $btn ->button_font_size) && $btn ->button_font_size!= '' ): ?> font-size: <?php echo esc_attr( $btn ->button_font_size ); ?> !important; <?php else : ?> font-size: 16px; <?php endif ; ?> <?php if (isset( $btn ->button_letter_spacing) && $btn ->button_letter_spacing!= '' ): ?> letter-spacing: <?php echo esc_attr( $btn ->button_letter_spacing ); ?> !important; <?php endif ; ?> <?php if (isset( $btn ->button_font_weight) && $btn ->button_font_weight!= '' ): ?> font-weight: <?php echo esc_attr( $btn ->button_font_weight ); ?> !important; <?php endif ; ?> margin-right: 10px; } .hero_btn1_exborder:before{ border-color: <?php echo esc_attr( $btn ->button_background_color); ?> !important; } .hero_btn1_exborder:after{ border-color: <?php echo esc_attr( $btn ->button_background_color); ?> !important; } .hero_btn1_exborder:hover, .hero_btn1_exborder.hover{ background-color: <?php echo esc_attr( $btn ->button_background_color); ?>; <?php if ( $btn ->button_hover_color!= '' ) : ?> color:<?php echo esc_attr( $btn ->button_hover_color); ?> !important; <?php endif ; ?> } </style> <a href= "<?php echo esc_url($btn->button_url); ?>" target= "<?php echo esc_attr($btn->button_target); ?>" class = "hero_exborder hero_btn1_exborder" ><?php echo esc_attr( $btn ->button_text); ?></a> <?php else : ?> <a href= "<?php echo esc_url($btn->button_url); ?>" target= "<?php echo esc_attr($btn->button_target); ?>" class = "slider_hero_btn_cls_one" ><?php echo esc_attr( $btn ->button_text); ?></a> <?php endif ; ?> <?php } elseif ( $type == '2' && $btn2 ->hero_button_shortcode== '1' ){ ?> <style type= "text/css" > .hero_btn_cls_one2{ <?php if ( $btn2 ->button_border== 'square' ) : ?> border-radius: 0px; <?php else : ?> border-radius: 35px 35px; <?php endif ?> <?php if ( $btn2 ->button_style== 'full_background' ) : ?> background: <?php echo esc_attr( $btn2 ->button_background_color); ?>; <?php else : ?> background: none; <?php endif ; ?> border: 2px solid <?php echo esc_attr( $btn2 ->button_background_color); ?> !important; padding: 12px 20px; box-sizing: content-box; text-decoration: none; min-width:100px; color: <?php echo esc_attr( $btn2 ->button_color); ?> !important; text-shadow: none; <?php if (isset( $btn2 ->button_font_size) && $btn2 ->button_font_size!= '' ): ?> font-size: <?php echo esc_attr( $btn2 ->button_font_size ); ?> !important; <?php else : ?> font-size: 16px; <?php endif ; ?> <?php if (isset( $btn2 ->button_letter_spacing) && $btn2 ->button_letter_spacing!= '' ): ?> letter-spacing: <?php echo esc_attr( $btn2 ->button_letter_spacing ); ?> !important; <?php endif ; ?> <?php if (isset( $btn2 ->button_font_weight) && $btn2 ->button_font_weight!= '' ): ?> font-weight: <?php echo esc_attr( $btn2 ->button_font_weight ); ?> !important; <?php endif ; ?> display: -webkit-inline-flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; -webkit-box-pack: center; -webkit-flex-pack: center; -webkit-justify-content: center; -webkit-flex-align: center; -webkit-align-items: center; vertical-align: middle; } .hero_btn_cls_one2:hover{ <?php if ( $btn2 ->button_hover_color!= '' ) : ?> color:<?php echo esc_attr( $btn2 ->button_hover_color); ?>!important; <?php endif ; ?> <?php if ( $btn2 ->button_background_hover_color!= '' ): ?> <?php if ( $btn2 ->button_style== 'full_background' ): ?> background: <?php echo esc_attr( $btn2 ->button_background_hover_color); ?>; <?php else : ?> background: none; <?php endif ; ?> border: 2px solid <?php echo esc_attr( $btn2 ->button_background_hover_color); ?> !important; <?php endif ; ?> } </style> <?php //Button 2 Glitch Effect // if (isset( $btn2 ->button_effect) and $btn2 ->button_effect== 'glitch' ): ?> <style type= "text/css" > .shero_glitch_button > a:link{ color: <?php echo esc_attr( $btn2 ->button_color); ?>; } .shero_glitch_button > a:hover{ color: <?php echo esc_attr( $btn2 ->button_hover_color); ?>!important; } </style> <label for = "switch" class = "shero_glitch_button hero_btn_cls_one2" ><a href= "<?php echo esc_url($btn2->button_url); ?>" target= "<?php echo esc_attr($btn2->button_target); ?>" class = "" ><?php echo esc_attr( $btn2 ->button_text); ?></a></label> <?php // Button 2 Fill Effect // elseif (isset( $btn2 ->button_effect) and $btn2 ->button_effect== 'fill' ): ?> <style type= "text/css" > .hero_btn2_fill { color: <?php echo esc_attr( $btn2 ->button_color); ?> !important; border: 2px solid <?php echo esc_attr( $btn2 ->button_background_color); ?> !important; <?php if ( $btn2 ->button_border== 'square' ) : ?> border-radius: 0px; <?php else : ?> border-radius: 35px 35px; <?php endif ?> text-shadow: none; <?php if (isset( $btn2 ->button_font_size) && $btn2 ->button_font_size!= '' ): ?> font-size: <?php echo esc_attr( $btn2 ->button_font_size ); ?> !important; <?php else : ?> font-size: 16px; <?php endif ; ?> <?php if (isset( $btn2 ->button_letter_spacing) && $btn2 ->button_letter_spacing!= '' ): ?> letter-spacing: <?php echo esc_attr( $btn2 ->button_letter_spacing ); ?> !important; <?php endif ; ?> <?php if (isset( $btn2 ->button_font_weight) && $btn2 ->button_font_weight!= '' ): ?> font-weight: <?php echo esc_attr( $btn2 ->button_font_weight ); ?> !important; <?php endif ; ?> } .hero_btn2_fill:before { background: <?php echo esc_attr( $btn2 ->button_background_color); ?>; } .hero_btn2_fill:hover { <?php if ( $btn2 ->button_hover_color!= '' ) : ?> color:<?php echo esc_attr( $btn2 ->button_hover_color); ?> !important; <?php endif ; ?> } </style> <a href= "<?php echo esc_url($btn2->button_url); ?>" target= "<?php echo esc_attr($btn2->button_target); ?>" class = "hero_btn hero_btn--border hero_btn--primary hero_btn--animated hero_btn2_fill" ><?php echo esc_attr( $btn2 ->button_text); ?></a> <?php // Area for Spin Effect elseif (isset( $btn2 ->button_effect) and $btn2 ->button_effect== 'spin' ): ?> <a href= "<?php echo esc_url($btn2->button_url); ?>" target= "<?php echo esc_attr($btn2->button_target); ?>" ><div class = "hero_spinner_tag hero_btn_cls_one2" data-content- default = "<?php echo esc_attr($btn2->button_text); ?>" data-content-spinning= "<?php echo esc_attr($btn2->button_text); ?>" ></div></a> <?php // Area for Shiney Effect elseif (isset( $btn2 ->button_effect) and $btn2 ->button_effect== 'shiney' ): ?> <a href= "<?php echo esc_url($btn2->button_url); ?>" target= "<?php echo esc_attr($btn2->button_target); ?>" class = "slider_hero_btn_cls_one hero_shiney_effect" ><?php echo esc_attr( $btn2 ->button_text); ?></a> <?php // Area for 3D Effect elseif (isset( $btn2 ->button_effect) and $btn2 ->button_effect== '3d' ): ?> <style type= "text/css" > .hero_btn2_3d { color: <?php echo esc_attr( $btn2 ->button_color); ?> !important; background: #fff; border: 5px solid <?php echo esc_attr( $btn2 ->button_background_color); ?> !important; color: <?php echo esc_attr( $btn2 ->button_background_color); ?>; padding: 12px 20px; font-size: 16px; text-shadow: none; <?php if (isset( $btn2 ->button_font_size) && $btn2 ->button_font_size!= '' ): ?> font-size: <?php echo esc_attr( $btn2 ->button_font_size ); ?> !important; <?php else : ?> font-size: 16px; <?php endif ; ?> <?php if (isset( $btn2 ->button_letter_spacing) && $btn2 ->button_letter_spacing!= '' ): ?> letter-spacing: <?php echo esc_attr( $btn2 ->button_letter_spacing ); ?> !important; <?php endif ; ?> <?php if (isset( $btn2 ->button_font_weight) && $btn2 ->button_font_weight!= '' ): ?> font-weight: <?php echo esc_attr( $btn2 ->button_font_weight ); ?> !important; <?php endif ; ?> } .hero_btn2_3d:before{ background: <?php echo esc_attr( $btn2 ->button_background_color); ?>; } .hero_btn2_3d:after{ background: <?php echo esc_attr( $btn2 ->button_background_color); ?>; } .hero_btn2_3d:hover{ background: <?php echo esc_attr( $btn2 ->button_background_color); ?>; <?php if ( $btn2 ->button_hover_color!= '' ) : ?> color:<?php echo esc_attr( $btn2 ->button_hover_color); ?>!important; <?php endif ; ?> } </style> <a href= "<?php echo esc_url($btn2->button_url); ?>" target= "<?php echo esc_attr($btn2->button_target); ?>" class = "hero_3d_button hero_btn2_3d" ><?php echo esc_attr( $btn2 ->button_text); ?></a> <?php // Area for Expending Border Effect elseif (isset( $btn2 ->button_effect) and $btn2 ->button_effect== 'exborder' ): ?> <style type= "text/css" > .hero_btn2_exborder { color: <?php echo esc_attr( $btn2 ->button_color); ?> !important; background-color: <?php echo esc_attr( $btn2 ->button_background_color); ?>; border: 5px solid <?php echo esc_attr( $btn2 ->button_background_color); ?> !important; font-size: 16px; text-decoration: none; min-width:100px; padding: 12px 20px; <?php if (isset( $btn2 ->button_font_size) && $btn2 ->button_font_size!= '' ): ?> font-size: <?php echo esc_attr( $btn2 ->button_font_size ); ?> !important; <?php else : ?> font-size: 16px; <?php endif ; ?> <?php if (isset( $btn2 ->button_letter_spacing) && $btn2 ->button_letter_spacing!= '' ): ?> letter-spacing: <?php echo esc_attr( $btn2 ->button_letter_spacing ); ?> !important; <?php endif ; ?> <?php if (isset( $btn2 ->button_font_weight) && $btn2 ->button_font_weight!= '' ): ?> font-weight: <?php echo esc_attr( $btn2 ->button_font_weight ); ?> !important; <?php endif ; ?> } .hero_btn2_exborder:before{ border-color: <?php echo esc_attr( $btn2 ->button_background_color); ?> !important; } .hero_btn2_exborder:after{ border-color: <?php echo esc_attr( $btn2 ->button_background_color); ?> !important; } .hero_btn2_exborder:hover, .hero_btn2_exborder.hover{ background-color: <?php echo esc_attr( $btn2 ->button_background_color); ?>; <?php if ( $btn2 ->button_hover_color!= '' ) : ?> color:<?php echo esc_attr( $btn2 ->button_hover_color); ?> !important; <?php endif ; ?> } </style> <a href= "<?php echo esc_url($btn2->button_url); ?>" target= "<?php echo esc_attr($btn2->button_target); ?>" class = "hero_exborder hero_btn2_exborder" ><?php echo esc_attr( $btn2 ->button_text); ?></a> <?php else : ?> <a href= "<?php echo esc_url($btn2->button_url); ?>" target= "<?php echo esc_attr($btn2->button_target); ?>" class = "hero_btn_cls_one2" ><?php echo esc_attr( $btn2 ->button_text); ?></a> <?php endif ; ?> <?php } ?> <?php } $output = ob_get_contents(); ob_end_clean(); return $output ; } |
Code file location:
slider-hero/slider-hero/qc-fnc/qcld_sliderhero_shortcode.php
[qcld_hero] Shortcode
The Slider Hero shortcode is a powerful tool that allows the display of a specific Slider Hero on a page. This shortcode, when inserted into a post or a page, calls the ‘qcld_qchero_resliders_shortcode’ function. The function takes in parameters ‘id’ and ‘preloader’ to load the front-end slider.
Shortcode: [qcld_hero]
Parameters
Here is a list of all possible qcld_hero shortcode parameters and attributes:
id
– The unique identifier of the slider to be displayedpreloader
– Determines whether the preloader will be shown or not
Examples and Usage
Basic example – Showcases the shortcode usage by referencing the ID parameter of the Slider Hero plugin.
[qcld_hero id=1 /]
Advanced examples
1. Using the shortcode to display a slider by referencing the ID and preloader parameters. The slider will load with the specified ID and preloader settings.
[qcld_hero id=2 preloader=on /]
2. Using the shortcode without specifying the ID or preloader. The plugin will display the default slider with default preloader settings.
[qcld_hero /]
3. Using the shortcode with only the preloader parameter. The plugin will display the default slider with specified preloader settings.
[qcld_hero preloader=off /]
These examples demonstrate the flexibility of the Slider Hero plugin shortcode, allowing you to customize your slider display according to your needs.
PHP Function Code
In case you have difficulties debugging what causing issues with [qcld_hero]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'qcld_hero', 'qcld_qchero_resliders_shortcode' );
Shortcode PHP function:
1 2 3 4 5 6 7 8 9 10 11 12 13 | function qcld_qchero_resliders_shortcode( $atts , $content , $tag ) { $atts = shortcode_atts( array ( 'id' => '' , 'preloader' => '' , ), $atts ); return qcld_qchero_load_front_end_slider( $atts ); } |
Code file location:
slider-hero/slider-hero/qcld-slider-main.php
Conclusion
Now that you’ve learned how to embed the Slider Hero with Animation, Video Background Plugin shortcodes, 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