Wordpress Get post in index page

<ul>
<?php


$args = array( 'posts_per_page' => 5,'category' => 1 );

$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
 <li>
  <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
 </li>
<?php endforeach; 
wp_reset_postdata();?>

</ul>

Comments

Popular posts from this blog

Jquery Captcha validation plugin

Resize ReCaptcha width height