WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Adding posts to a static page (2 posts)

  1. Richard
    Member
    Posted 1 year ago #

    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"

    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 :

    <?php
     global $post;
     $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?

    Thank you.

    Richard

  2. Richard
    Member
    Posted 1 year ago #

    post-in-page plugin solved my problem

Topic Closed

This topic has been closed to new replies.

About this Topic