Last active
August 29, 2015 13:56
-
-
Save fieldoffice/9155581 to your computer and use it in GitHub Desktop.
Display content from another page in WordPress
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
//Add to functions.php | |
function page_me($path) { | |
$post = get_page_by_path($path); | |
$content = apply_filters('the_content', $post->post_content); | |
echo $content; | |
} | |
//Add to template | |
<?php page_me('pagename');?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment