Skip to content

Instantly share code, notes, and snippets.

@iamchetanp
Created October 22, 2019 18:27
Show Gist options
  • Save iamchetanp/0b70f2a09e2ca9312c55509bba643061 to your computer and use it in GitHub Desktop.
Save iamchetanp/0b70f2a09e2ca9312c55509bba643061 to your computer and use it in GitHub Desktop.
Recent Posts1=
<?php
/**
* Shortcode for posts
*
* @package Divi
*/
$posts_args = array(
'post_type' => 'post',
'posts_per_page' => '3',
);
query_posts( $posts_args );
?>
<div id="posts-list" class="posts-wrap">
<?php
while ( have_posts() ) :
the_post();
?>
<div class="post-item">
<div class="post-wrap">
<div class="post-image">
<a class="post-link" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail( 'medium' ); ?>
</a>
</div>
<div class="post-details">
<h4><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h4>
<?php the_excerpt(); ?>
<div class="read-more">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">Read More +</a>
</div>
</div>
</div>
</div>
<?php
endwhile;
wp_reset_query();
?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment