1

How do I show the excerpt in the same post is page?

Example:

<?php
if ( the_excerpt() != '' ) {
echo $my_excerpt; 
}
?>

But this does not work!

4

1 回答 1

1

the_excerpt()将回显摘录,而get_the_excerpt()将返回它。所以尝试这样的事情:

<?php
  $my_excerpt = get_the_excerpt();
  if ( $my_excerpt != '' ) {
    echo $my_excerpt; 
  }
?>
于 2013-04-24T19:28:00.007 回答