Adding posts to a static page
I have looked all over this site for an answer I can use. That being said there seems to be a lot of solutions, but I am such a novice at this that most of it goes over my head……
I want to add recent posts to my static home page. under the section that says “Upcoming Events” Website in question
Someone on one of the forums suggested using the following code information.:
“The easiest way to do this is adding to your static page a get_posts call.
Here’s one example of a minimal Loop of that kind :
$myposts = get_posts(‘numberposts=5&category=1’);
foreach($myposts as $post) :
<?php the_title(); ?>
<?php the_content(); ?>
<?php endforeach; ?>”
[Please use the code buttons when posting code here]
The problem is I dont know where to put this code to show up on my page where I want it.
Can anyone shed some light on this for me?
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
The topic ‘Adding posts to a static page’ is closed to new replies.