Show Page’s Content Anywhere using PHP Code in WordPress

Show Page’s content to another page or anywhere in your theme. Use PHP code and make it to show in your WordPress’s Website.

Code

<?php
// query for the about page
$your_query = new WP_Query( 'pagename=contact-us' );
// "loop" through query (even though it's just one page)
while ( $your_query->have_posts() ) : $your_query->the_post();
the_content();
endwhile;
// reset post data (important!)
wp_reset_postdata();
?>

How to DO

First of all open your active theme’s page.php. Then paste code and change highlighted work of which page’s content you want to show. Then SAVE page.php.

Watch Video