Last active
August 29, 2015 14:21
-
-
Save robgolbeck/4f70d834508f346363ae to your computer and use it in GitHub Desktop.
Show content from one page on another page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add this to functions.php | |
function hc_show_content($path) { | |
$post = get_page_by_path($path); | |
$content = apply_filters('the_content', $post->post_content); | |
echo $content; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Now add this to your page or post type template. | |
// Replace 'page-slug' with the slug of the page you want the content from (leave the quotes) | |
hc_show_content('page-slug'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment