Wordpress Post Excerpt From Post Id

[Solved] Wordpress Post Excerpt From Post Id | Perl - Code Explorer | yomemimo.com
Question : wordpress post excerpt from post id

Answered by : lokesh-ramchandani

<?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;
?>

Source : | Last Update : Fri, 25 Jun 21

Answers related to wordpress post excerpt from post id

Code Explorer Popular Question For Perl