On my homepage I have a "recent posts" sidebar with a link to the blog. It's a .php include. I want to list the headings of recent posts on there. Can someone please tell me how I can do this? I want it to update this automatically.
Thank you!
On my homepage I have a "recent posts" sidebar with a link to the blog. It's a .php include. I want to list the headings of recent posts on there. Can someone please tell me how I can do this? I want it to update this automatically.
Thank you!
All you would need to change in the following code would be the "category_name=" to be the category you want to display.
<?php query_posts('category_name=events'); ?>
<?php while (have_posts()) : the_post(); ?>
<ul>
<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
</ul>
<?php endwhile; ?>
Hope this helps!
Derek M.
Thanks for your help, but my homepage is outside of the blog folder (its actually the main websites .index homepage). Can you please tell me how I can use that code on a web page that is not part of the actual blog?
Thanks!
Here are a couple of articles that may help.
Creating a static front page on your WordPress blog
WordPress Codex: Creating a Static Front Page
This topic has been closed to new replies.