Created
February 12, 2015 17:01
-
-
Save tacensi/1abfd3dab659e37bec20 to your computer and use it in GitHub Desktop.
Get a post excerpt 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
// get excerpt by id | |
function mg_get_the_excerpt($post_id) { | |
global $post; | |
$save_post = $post; | |
$post = get_post($post_id); | |
$output = get_the_excerpt(); | |
$post = $save_post; | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment