How to embed a WordPress page inside another page

Sometimes you will create a template or a page that will require you to embed the content from another page. There are a couple of plugins that will help you do this, like Improved Include Page but I don’t like to install plugins just because they exist.

The code

To make it work, you will need to replace ID with the page that you want to embed. If you are working on another loop on the same page, don’t forget to reset the query by using wp_reset_query();