admin管理员组文章数量:1130349
I am running into an issue with Gutenberg where I want to display the excerpt of a post, even when the excerpt field isn't filled in. Usually the functionality of WordPress is when the excerpt is empty to grab the first few lines of text from the content editor. With Gutenberg however when it does that it injects the page with additional HTML Elements, mainly p tags, screwing up the rest of the page.
If I add an excerpt manually in that post's excerpt field this issue is resolved and additional HTML elements aren't injected. But I can't rely on my client to always fill out the excerpt field, so I am trying to find a solution where I can use:
get_the_excerpt();
And if the excerpt field isn't filled out pull just text from the Gutenberg editor and not additional HTML elements. I assume this issue is with how Gutenberg works with the content editor containing everything in one.
Has anyone else ran into this issue and knows of a solution for this?
I am running into an issue with Gutenberg where I want to display the excerpt of a post, even when the excerpt field isn't filled in. Usually the functionality of WordPress is when the excerpt is empty to grab the first few lines of text from the content editor. With Gutenberg however when it does that it injects the page with additional HTML Elements, mainly p tags, screwing up the rest of the page.
If I add an excerpt manually in that post's excerpt field this issue is resolved and additional HTML elements aren't injected. But I can't rely on my client to always fill out the excerpt field, so I am trying to find a solution where I can use:
get_the_excerpt();
And if the excerpt field isn't filled out pull just text from the Gutenberg editor and not additional HTML elements. I assume this issue is with how Gutenberg works with the content editor containing everything in one.
Has anyone else ran into this issue and knows of a solution for this?
本文标签: the contentGutenberg is Adding Additional HTML Tags When Grabbing the Excerpt
版权声明:本文标题:the content - Gutenberg is Adding Additional HTML Tags When Grabbing the Excerpt 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749104714a2316562.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论