<?php
/**
* Template Name: e-shop
*
*/
get_header();
?>
<section class="welcome-section-eshop-page">
<div class="swiper-container mySwiper4">
<div class="swiper-wrapper">
<div class="swiper-slide">
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail( 'full', array( 'class' => 'banner-photo' ) ); // show featured image
}
?>
</div>
</div>
<div class="swiper-pagination welcome-pagination"></div>
</div>
</section>
<?php
if (have_posts()):
while (have_posts()) : the_post();
the_content();
endwhile;
else:
echo '<p>Sorry, no posts matched your criteria.</p>';
endif;
?>
<section class="lajmet">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>Lajme & Evente</h2>
</div>
<div class="col-md-12">
<?php
global $post;
$args = array( 'posts_per_page'=>5 , 'post_type'=> 'lajme', 'orderby=ID&order=ASC' );
$myposts = get_posts( $args );
$counter=1;?>
<!-- Swiper -->
<div class="swiper swiper-lajmet">
<div class="swiper-wrapper">
<?php foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
<div class="swiper-slide lajmet-box">
<div class="row">
<div class="col-md-6">
<div class="lajmet-div lajmet-image">
<?php
if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
the_post_thumbnail( 'full', array( 'class' => 'banner-photo' ) ); // show featured image
}
?>
</div>
</div>
<div class="col-md-6">
<div class="lajmet-div">
<h3> <?php echo esc_html( get_the_title() ); ?></h3>
<p><?php the_field('short_description'); ?></p>
<p><?php echo get_the_date(); ?></p>
</div>
</div>
<div class="col-md-12">
<a href="<?php print get_the_permalink();?>">Повеќе</a>
</div>
</div>
</div><?php
$counter++;
endforeach; ?>
</div>
<div class="swiper-button-next lajme-next"></div>
<div class="swiper-button-prev lajme-prev"></div>
<div class="swiper-pagination lajmet-pagination"></div>
</div>
<?php wp_reset_postdata();?>
</div>
</div>
</div>
</section>
<?php
get_footer();
?>