WordPress display all pages on one page

To display all page contents in a single page, you can use the following code. It also helps to get the page title to display in a single page.

    $title = $page_data->post_title; 
    echo $content; 

To display a page content in another page:

$page_data = get_page( $page_id ); 
$content = apply_filters('the_content', $page_data->post_content); 
$title = $page_data->post_title; 
echo $content; 

About the author

Janaki(http://mjanaki.com) - A Software developer with 9+ years of experience in multiple technology projects across web, mobile, and cloud applications with expertise in PHP, C#, MySQL, Web services and open source platforms.

Similar Posts

WordPress Get Page Content By Page Id
Query X Number of Recent Posts
WordPress Tricks

Leave a reply


Eye Test: * Time limit is exhausted. Please reload CAPTCHA.