Skip to main content
Home / Code Snippets / WordPress / Embed a Page inside a Page

Embed a Page inside a Page

<?php $recent = new WP_Query("page_id=**ID**"); while($recent->have_posts()) : $recent->the_post();?>
       <h3><?php the_title(); ?></h3>
       <?php the_content(); ?>
<?php endwhile; ?>

The above code can be used within the regular page loop. Replace **ID** with the ID of the page you wish to embed.

icon-link icon-logo-star icon-search icon-star