I created a slider shortcode in my custom theme. My sliders images display at the background image. I don't know how can I display background slider images using shortcode
Here is my code:
$string .=' <div class="main-slider-item" style="background-image: url(<?php echo $backgroundImg[0]; ?>); background-size: cover; background-repeat: no-repeat;">' .
' <div class="d-table">' .
' <div class="d-table-cell">' .
'<div class="container">'.
' <div class="main-slider-content">' .
'<h1>' . get_the_title() . '</h1>' .
get_the_content() .
' <div class="slider-btn">'.
'<a href="'.$slider_buttons1link.'" class="default-btn">' . $slider_buttons1txt . '</a>' .
'<a href="'.$slider_buttons2link.'" class="default-btn-two">' . $slider_buttons2txt . '</a>' .
'</div>'.
' </div>' .
'</div>' .
' </div>'.
' </div>' .
'</div>';