wordpress-theme / category-news.php
category-news.php
Raw
<?php get_header(); ?>
<h1 class='service-heading'>Latest News</h1>
<div class="allservices-section">
<?php 
    if ( have_posts() ) {
        while ( have_posts() ) {
            the_post(); 
            ?>
            <article >
                <?php  
                    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
                        $thumbnail_url = get_the_post_thumbnail_url('', 'post-thumbnails');    
                    } 
                ?>
                <div class="article-img-wrapper">
                    <img alt="'" src='<?php echo $thumbnail_url; ?>'>
                </div> 
                <div class="heading2"><?php the_title(); ?> </div>
        
                <br> <br> 
                <div class="service-content"> <?php the_excerpt(); ?> </div> <br>
                <a href= "<?php the_permalink(); ?>" >
                    <span class="btn-details"> Details </span></a>
            </article>
            <?php
        } 
    }    
        ?>
</div>
<?php get_footer(); ?>