/ Published in: PHP

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.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//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. ?>
Comments
