Created
May 20, 2013 12:52
-
-
Save mkdizajn/5612031 to your computer and use it in GitHub Desktop.
wordpress function to get page content by ID
This file contains 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 | |
// mk function to get page content by id! | |
// function() -> takes post ID | |
function mk_get_page_content_by_id( $pid ){ | |
$page_id = $pid; | |
$page_data = get_page( $page_id ); | |
$content = apply_filters('the_content', $page_data->post_content); | |
echo $content; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment