<?php $allPageIDs = get_all_page_ids(); foreach($allPageIDs as $pageID) { $page_data = get_page( $pageID ); $content = apply_filters('the_content', $page_data->post_content); $title = $page_data->post_title;?> <div> <h2><?php echo $title; ?></h2> <div><?php echo $content; ?></div> </div><?php }?>
$pages = get_pages();foreach ( $pages as $page ) { $content = $page->post_content; // I'm not sure if it's post_content. print_r( $page ); to see what you should use $title = $page->post_title; $output = '<h2>' . $title . '</h2>'; $output .= '<div>' . $content . '</div>'; echo $output;}
However, there is a problem. They're displaying out of order. Since it's going by page id, it's going in the order that I created them, and not their set post order. Any Idea how I can fix this?
It would be something like: