Post a Page in a Page

Supplemental 21 views
0 Flares 0 Flares ×

This allows you to post a page inside a query loop or in the single.php or page.php files only with any custom post template.

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

Finding the Page ID

To find the page ID you need to highlight your mouse over the page of choice and look at the bottom left string and sift through it for the number (view screenshot).
Finding page ID

Posted in Wordpress


Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

No Trackbacks.


Register | Lost your password?
0 Flares Twitter 0 Facebook 0 Google+ 0 0 Flares ×