admin管理员组文章数量:1125971
How do I register a shortcode to add the manual post excerpt anywhere within the same post? Does this shortcode already exist in WP?
Thanks!
How do I register a shortcode to add the manual post excerpt anywhere within the same post? Does this shortcode already exist in WP?
Thanks!
Share Improve this question asked Apr 26, 2019 at 16:46 auntieauntie 351 silver badge5 bronze badges 2- If we want to run this code with the program (Code Snippets), how do we do this? – user233657 Commented Jul 3, 2023 at 15:45
- @user233657 you shouldn't post questions in the solutions box to other users questions. Code snippets support can help you, but 3rd party plugin questions are offtopic here – Tom J Nowell ♦ Commented Jul 3, 2023 at 17:02
1 Answer
Reset to default 3Just add this to your child theme's functions.php
file:
add_shortcode( 'output_post_excerpt', 'get_the_excerpt' );
Then use [output_post_excerpt]
本文标签: Retrieving post excerpt as a shortcode
版权声明:本文标题:Retrieving post excerpt as a shortcode 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736676544a1947210.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论