Support » Themes and Templates » Front page with page content and articles

  • 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 ?


Viewing 1 replies (of 1 total)
  • 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 ?

Viewing 1 replies (of 1 total)
  • The topic ‘Front page with page content and articles’ is closed to new replies.