WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've created a page named "homepage", set the page as front page from Reading > Static Page > Front page and it's nearly working fine. The issue I'm having the blog posts aren't included into the page. It comes with the blank page and I need to change order as "menu_order", not working.

In other words, I need to get the pages in order as same as the navigation.

 * The main template file.
 * Template Name: One


$pages = get_posts(array(
    'posts_per_page' => -1,
    'post_type' => 'page',
    'order' => 'ASC'

foreach($pages as $_post) {
    $content = apply_filters('the_content', $_post->post_content);
    $title = $_post->post_title;
    $slug = $_post->post_name;

-div class content-

get_footer(); ?>
share|improve this question
The previous title didn't make sense. But I'm not sure I've captured the issue in the new one. What does not work: blog posts not showing or pages not in the correct order? – brasofilo Jul 12 '13 at 2:48

If you want the page to display your blog posts then you need to either change the front page reading option to latest posts then use either index.php or create a new file named front-page.php.

If you want your page query ordered by menu_order you need to add 'orderby' => 'menu_order' to the query.

share|improve this answer
First of all, than you for the answer. Secondly, when I change the front page settings, I can view the blog post but can't view other pages. What I need to view both blog posts and pages at the front page. By the way, navigation issue still persists. Current navigation order is :services/about/portfolio/contact/blog but what i get after adding the code you've suggested is :about/contact/blog/services/portfolio – Yigit Ce. Yigit Jul 12 '13 at 11:57
Bump? Anyone? Bump? – Yigit Ce. Yigit Jul 16 '13 at 19:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.