Front page with page content and articles (2 posts)

  1. schwipps
    Posted 2 years ago #

    Hi there,
    I'm trying to build a front page for a corporate website, on which I want to put a introduction text, plus last 3 articles published.

    So, I created a front page specific page model, based on single.php, and where I inserted the following code :

                    $args = array( 'numberposts' => '1', 'post_status'=> 'publish' );
                    $recent_posts = wp_get_recent_posts( $args );
                        foreach( $recent_posts as $recent ){
                                    <a href="'.get_permalink($recent["ID"]).'"

    Now the point is that this function returns the content of the page article in place of the first post.

    How can I prevent this ? Is there a solution to filter pages from posts ?


  2. schwipps
    Posted 2 years ago #

    This is very weird... I figured that the shown title is the right one, but the excerpt is not : it's always the content of the page.

    Can somebody explain me what goes wrong here ?

Topic Closed

This topic has been closed to new replies.

About this Topic