Latest one post full rest with excerpt with featured image

How to show custom view in wordpress blog? I searches for the code in the web and got some idea and here is the full code you may like to create a custom view for your blog. Latest one psot full rest with excerpt with featured image. just replace the content section/div with the following code.

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); $counter++;  ?>

<div class=”date”> <?php the_date(); ?></div><!–date–>

<div class=”posttitle”>

<h2><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></h2>

</div><!–posttitle–>

<?php

if ( has_post_thumbnail() ) { the_post_thumbnail();

}

?>

<?php

if( is_home() && !is_paged() && ($posts[0] == $post) ) {

echo apply_filters(‘the_content’, $post->post_content);

} else {

the_excerpt();

}

?>

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *