Answers for "wordpress post excerpt from post id"

0

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;
?>
Posted by: Guest on June-18-2021

Browse Popular Code Answers by Language