Skip to content

Instantly share code, notes, and snippets.

@fieldoffice
Last active August 29, 2015 13:56
Show Gist options
  • Save fieldoffice/9155581 to your computer and use it in GitHub Desktop.
Save fieldoffice/9155581 to your computer and use it in GitHub Desktop.
Display content from another page in WordPress
//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