<?php
/**
* Template Name: blog
*
*/
get_header();
?>
<section class="welcome-section-brandet">
<?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 class="about-page-info">
<h3>Novosti & eventi</h3>
</div>
</section>
<section class="blog-content">
<div class="container">
<div class="row">
<div class="col-lg-10 offset-lg-1">
<?php
global $post;
$args = array( 'posts_per_page'=>1234123123123123 , 'post_type'=> 'lajme', 'orderby=ID&order=ASC' );
$myposts = get_posts( $args );
$counter=1;?>
<?php foreach ( $myposts as $post ) : setup_postdata( $post );?>
<?php if($counter%2==0){?>
<div class="row blog-background">
<div class="col-md-6 blog-center-items blog-mobile-order">
<div class="blog-div-details blog-right-div">
<h3> <?php echo esc_html( get_the_title() ); ?></h3>
<p><?php the_field('short_description'); ?></p>
<a href="<?php print get_the_permalink();?>">Повеќе</a>
</div>
</div>
<div class="col-md-6 blogcenter-items">
<div class="grand-design-left-div blog-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>
<?php } if($counter%2==1){?>
<div class="row blog-background">
<div class="col-md-6 blog-center-items">
<div class="blog-left-div blog-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 blog-center-items">
<div class="blog-div-details blog-left-div">
<h3> <?php echo esc_html( get_the_title() ); ?></h3>
<p><?php the_field('short_description'); ?></p>
<a href="<?php print get_the_permalink();?>">Повеќе</a>
</div>
</div>
</div>
<?php }?>
<?php
$counter++;
endforeach; ?>
<?php wp_reset_postdata();?>
</div>
</div>
</div>
</section>
<?php
get_footer();
?>