C:\xampp\htdocs\landing\wp-content\plugins\penci-pennews-amp\templates\featured-slider.php


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

<div class="homepage-slider">
    <amp-carousel class="amp-slider amp-featured-slider" layout="responsive" type="slides" width="780" height="500" delay="3500">
    <?php
    $featured_args 
= array(
        
'post_type'           => 'post',
        
'posts_per_page'      => 3,
        
'ignore_sticky_posts' => TRUE,
        
'meta_query'          => array( // only posts with thumbnail
            
'key' => '_thumbnail_id'
        
)
    );

    
$featured_slider_query = new WP_Query$featured_args );
    if ( 
$featured_slider_query->have_posts() ) {
        while ( 
$featured_slider_query->have_posts() ) {
            
$featured_slider_query->the_post();

            
$src penci_amp_post_thumbnail( array(
                    
'post' => get_the_ID(),
                    
'size' => 'penci-thumb-760-570',
                    
'return_url' => true
                
)
            );
            echo 
'<div class="slider-item">';
            echo 
'<div id="penci-slider-img-holder' get_the_ID() . '" class="img-holder"></div>';
            echo 
'<div class="content-holder"><h3><a href="' get_the_permalinkget_the_ID() ) . '">' get_the_titleget_the_ID() ) . '</a></h3></div>';
            echo 
'</div>';
        }

        
wp_reset_postdata();
    }
    
?>
    </amp-carousel>
</div>
<?php
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586