%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/pn/beta/64801_wp-content/themes/intosai/templates/sections/
Upload File :
Create Path :
Current File : /var/www/pn/beta/64801_wp-content/themes/intosai/templates/sections/latest_news.php

<?php $newsCount = get_sub_field('news_to_show'); ?>

<section class="content_section latest_news newscount_<?php echo $newsCount; ?>">
    <div class="wrapper">

        <?php if(get_sub_field('center_title')){ ?>
            <div class="centered_title">
                <h2>Latest news</h2>
            </div>
        <?php }else{ ?>
            <div class="normal_title">
                <h2>Latest news</h2>
            </div>
        <?php } ?>

        <?php
            $args = array(
                'post_type'         =>      'post',
                'posts_per_page'    =>      $newsCount,
            );
        ?>

        <?php $the_query = new WP_Query($args);
        if($the_query->have_posts()) :
        if($newsCount == 3 || $newsCount == 6){ $n = 2; }elseif($newsCount == 4){ $n = 1; }
        while ($the_query->have_posts()) : $the_query->the_post();  ?>

            <a href="<?php the_permalink(); ?>">
                <div class="news_post<?php if($newsCount == 3 || $newsCount == 6){ if($n%3==0){echo' middle';} }elseif($newsCount == 4 || $newsCount == 8){ if($n==2){echo' middle_left';}elseif($n==3){echo' middle_right';} } ?>">

                    <figure class="news_thumb">
                        <?php the_post_thumbnail('newsThumb'); ?>
                    </figure>

                    <div class="meta"><?php echo get_the_date('m/d/Y'); ?></div>

                    <h3 class="titleFix"><?php the_title(); ?></h3>

                    <div class="excerpt">
                        <?php echo custom_excerpt(15); ?><br />
                        <span class="more">Continue reading</span>
                    </div>

                </div>
            </a>


            <?php if($newsCount == 4 || $newsCount == 8){
                if($n == 4){
                    $n = 0;
                }
            } ?>

        <?php $n++;
        endwhile;
        wp_reset_postdata();
        endif; ?>

    </div>
</section>

Zerion Mini Shell 1.0