最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - background featured image display using shortcode

programmeradmin1浏览0评论

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>';
发布评论

评论列表(0)

  1. 暂无评论