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 :
<ul> <?php $args = array( 'numberposts' => '1', 'post_status'=> 'publish' ); $recent_posts = wp_get_recent_posts( $args ); foreach( $recent_posts as $recent ){ echo ' <h2> <a href="'.get_permalink($recent["ID"]).'" title="'.esc_attr($recent["post_title"]).'" >'.$recent["post_title"].' </a> </h2> ' .get_the_excerpt($recent["ID"]); } ?> </ul>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 ?
Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Front page with page content and articles’ is closed to new replies.