admin管理员组文章数量:1297010
I use a static page (Blog) to display the latest posts. I want to show the excerpt of that page next to the title. However, wen I use wp_kses_post( get_the_excerpt() )
, I get the excerpt of the latest post from the post archive loop. I also tried with wp_kses_post( get_the_archive_description() )
but it also does not seem to work.. Any idea how this can be done?
I use a static page (Blog) to display the latest posts. I want to show the excerpt of that page next to the title. However, wen I use wp_kses_post( get_the_excerpt() )
, I get the excerpt of the latest post from the post archive loop. I also tried with wp_kses_post( get_the_archive_description() )
but it also does not seem to work.. Any idea how this can be done?
1 Answer
Reset to default 1You can use get_queried_object()
to get the static page data, and then do something like so to get the excerpt of the page:
echo get_the_excerpt( get_queried_object() );
// Or to apply filters just as the_excerpt() does:
$excerpt = get_the_excerpt( get_queried_object() );
echo apply_filters( 'the_excerpt', $excerpt );
本文标签: archivesHow to Get The Excerpt of the page that displays Blog Posts
版权声明:本文标题:archives - How to Get The Excerpt of the page that displays Blog Posts 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741647694a2390286.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论