admin管理员组

文章数量:1317909

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>';

本文标签: custom post typesbackground featured image display using shortcode