Content arranging in wordpress

$pages = get_pages();
foreach ($pages as $page_data) {
  $content = apply_filters('the_content', $page_data->post_content);
  $title = $page_data->post_title;
  echo $content;
}

I want this code to be changes so i can create a one page website and show only those pages i need to show on front page.

Related posts

1 comment

  1. You can make use of the include parameter to include only the pages you need. Note, this parameter takes an array or a comma separated string of page ID’s

    You can try the following to only show pages 1, 2 and 3

    $args = array(
        'include' => array( 1, 2, 3 );
    );
    $pages = get_pages( $args );
    // REST OF YOUR CODE
    

Comments are closed.