HI, I had setup wordpress blog in my site. I want to show the recent 5 entries in my site home page. Can anyone help me by providing the scripts for doing that?
I customized it myself using php. you can do it like this: <?php if (have_posts()) : ?> <?php $x=0; ?> <?php while (have_posts() && $x != 5) : the_post(); ?> <?php $x++; ?> Code (markup):
Without touching the code, you can also go to 'Options'-'Reading'-'Blog Pages' and enter '5' in 'Show at most: (box) posts'. It will limit the loop to 5 entries. If you only wish to show the 5 latest entries titles, you can also use the code : <ul><?php wp_get_archives('type=postbypost&limit=5'); ?></ul>. Hope this helps, Sam
All of the solutions above are correct if he wants to display the latest X entries on his blog's sidebar for example. But by his description, he has a blog AND a website. He wants to display the last 5 posts on his site's index. Perhaps this needs clearing up,
If that's the case, he could do that by simply using the blog's RSS feed. I'm no php expert but I'm sure it can be done quite easily.
hey you can use the widget from the themes admin page. or you can use my plugin, a customizable plugin here. -cypher.