• Resolved typecastfilms

    (@typecastfilms)


    I’m having an exceptionally difficult time searching for this one.

    Essentially, I’m building a custom template for a page in WP. I’d like to insert another post into that page.

    I know that there must be a php command somewhere that will insert the content of a specified post, but I can’t find it.

    Is there any easier way to do this than creating a post with a blank custom template and inserting the full URL with an IFrame?

Viewing 2 replies - 1 through 2 (of 2 total)
  • TypecastFilms,

    Try the following code changing the page_id number to the page containing the content you would like to display.

    <?php $my_query = new WP_Query('page_id=896');
           while ($my_query->have_posts()) : $my_query->the_post();
           $do_not_duplicate = $post->ID; ?>
    
        <?php the_content(); ?>
     <?php endwhile; ?>
    Thread Starter typecastfilms

    (@typecastfilms)

    That is perfect. Thanks, doc!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Insert a page within a page’ is closed to new replies.