Created
November 13, 2016 08:57
-
-
Save sagarjadhav/6aef5a494404e12f6edf6d66bdc2e9a4 to your computer and use it in GitHub Desktop.
Get content by page ID
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 | |
/* | |
* Get content by page ID | |
*/ | |
function marvy_the_content_by_id( $id ) { | |
if ( isset( $id ) && 0 != $id ) { | |
global $post; | |
$post = get_post( $id ); | |
setup_postdata( $post ); | |
the_content(); | |
wp_reset_postdata( $post ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment