Monday, July 15, 2013

How to Embed a Page inside a Page in WordPress website

This snippet code can be used within the regular page loop to embed a page inside a page.
Replace **ID** with the ID of the page you wish to embed.

<?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; ?>

Disqus Comments