Display Your WordPress Recent Posts on a Static Page


Now in the area you want to display your recent posts insert the following


<div>
<h2>Blog</h2>
<div>
<ul>
<?php
$args = array( 'numberposts' => 2, 'post_status'=>"publish",'post_type'=>"post",'orderby'=>"post_date");
$postslist = get_posts( $args );

foreach ($postslist as $post) : setup_postdata($post); ?>

<li>
<h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
<p><?php the_date(); ?></p>
<p><?php the_content(); ?></p>
</li>

<?php endforeach; ?>

</ul>
</div>
</div>
Advertisements

One thought on “Display Your WordPress Recent Posts on a Static Page

  1. I discovered your “Display Your WordPress Recent Posts on a Static Page | Web Designer” page and noticed you could have a lot more traffic. I have found that the key to running a website is making sure the visitors you are getting are interested in your subject matter. There is a company that you can get traffic from and they let you try it for free. I managed to get over 300 targetted visitors to day to my website. Check it out here: http://nsru.net/fdse

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s