我试图在一个增强的小部件中显示一个页面的摘录。
我尝试了以下方法,但无效:
<?php
$id = 2550;
$post = get_post($id);
$content = apply_filters(\'the_content\', $post->post_excerpt);
return $content;
?>
我试图在一个增强的小部件中显示一个页面的摘录。
我尝试了以下方法,但无效:
<?php
$id = 2550;
$post = get_post($id);
$content = apply_filters(\'the_content\', $post->post_excerpt);
return $content;
?>
使用:
apply_filters( \'get_the_excerpt\', $post->post_excerpt )
这将在摘录中填入post_content
当没有摘录时,因为默认的过滤器会处理这个问题。在将提要导入自定义帖子类型时,如果将提要描述存储在post\\u摘录字段和post\\u内容字段中,会有什么不同吗?当我将内容保存到这两个字段中的任何一个时,是否有一些处理通过WordPress应用?