Created
January 26, 2014 04:47
-
-
Save webhasan/8628544 to your computer and use it in GitHub Desktop.
wp post excerpt
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
/** | |
* Function for post excerpt | |
*/ | |
function excerpt($num) { | |
$limit = $num+1; | |
$excerpt = explode(' ', get_the_excerpt(), $limit); | |
array_pop($excerpt); | |
$excerpt = implode(" ",$excerpt)." <a href='" .get_permalink($post->ID) ." ' class='".readmore."'>Read More ››</a>"; | |
echo $excerpt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment