Return to Snippet

Revision: 65019
at October 16, 2013 04:37 by FlashBuddy


Initial Code
//Add to functions.php
function show_post($path) {
  $post = get_page_by_path($path);
  $content = apply_filters('the_content', $post->post_content);
  echo $content;
}

//add to your page/post/template file
<?php show_post('about');  // Shows the content of the "About" page. ?>
<?php show_post('category/postname');  // Shows content of a Post page. ?>

Initial URL


Initial Description
By adding this function to ones functions.php and then a call in ones page.php, single.php, home.php, index.php or custom template file. You can include on page within another.

Initial Title
WordPress Include Page or Post within another Page or Post via Templates

Initial Tags


Initial Language
PHP