$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>the content - Gutenberg is Adding Additional HTML Tags When Grabbing the Excerpt|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

the content - Gutenberg is Adding Additional HTML Tags When Grabbing the Excerpt

matteradmin9PV0评论

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?

Post a comment

comment list (0)

  1. No comments so far