Display custom post

<?php if( $the_query->have_posts() ): ?> <ul> <?php while( $the_query->have_posts() ) : $the_query->the_post(); ?> <li> <h3> <?php $heading = get_field(‘front_page_heading’,$post->ID); echo substr( $heading, 0, 15 ).’..’; ?> </h3> <h4 ><?php echo get_field(‘sub_heading’,$post->ID); ?></h4> <?php if( $image ) : ?> <img src="<?php echo $image[‘sizes’][‘blog-img’]; ?>" alt="<?php echo $image[‘alt’]; ?>" class="img-responsive" /> <?php endif; ?> </li> <?php endif;… Read more »

<?php if( $the_query->have_posts() ): ?>
    
        <ul>
            <?php while( $the_query->have_posts() ) : $the_query->the_post(); ?>
                <li>
                    <h3>                            
                        <?php                                 
                            $heading = get_field('front_page_heading',$post->ID); 
                            echo substr( $heading, 0, 15 ).'..';                                
                        ?>                            
                    </h3>
                    <h4 ><?php echo get_field('sub_heading',$post->ID); ?></h4>
                    
                    <?php if( $image ) : ?>
                       <img src="<?php echo $image['sizes']['blog-img']; ?>" alt="<?php echo $image['alt']; ?>" class="img-responsive" />
                    <?php endif; ?>
             
                </li>
            <?php endif; endwhile; ?>
        </ul>

<?php endif; ?>

<?php wp_reset_query();     ?>

Share this Tutorial