Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress post excerpt from post id

<?php
$post = get_post( $post );
$excerpt = get_the_excerpt(); || ( $post->post_excerpt ) ? $post->post_excerpt : $post->post_content;
 
$excerpt = substr($excerpt, 0, 260);
$result = substr($excerpt, 0, strrpos($excerpt, ' '));
echo $result;
?>
 
PREVIOUS NEXT
Tagged: #wordpress #post #excerpt #post #id
ADD COMMENT
Topic
Name
3+5 =