Want to add wpautop function back into excerpts, along with other tags
-
I understand that excerpts get their tags stripped out. But I’d like to get them back in.
I read how the wpautop function adds <p> tags around paragraphs that are actually double line-breaks. I cannot seem to determine how this function is not used in excerpts, but is used in single pages and posts. I’d like to be able to add it back into my excerpts instead of having all my text run together regardless how it’s written in the post. I’ve studied the formatting.php file and it’s not clear how this function is not applied to excerpts.
How can I get wpautop to work with excerpts?
I’m on a Genesis setup and I’m using a function that adds tags back into the site, and trying to add <p> via this method won’t work because there are no native <p> in posts.
// Add html to archive content limit. add_filter( 'get_the_content_limit_allowedtags', 'custom_get_the_content_limit_allowedtags' ); function custom_get_the_content_limit_allowedtags() { return '<script>,<style>,<strong>,<b>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>'; }
There is one thing about this above text that is baffling me. While this function does bring the tags back in, an unfortunate consequence is that if a opening tag shows up in the excerpt and does not close before the excerpt cutoff, that tag goes into all the rest of the page.
So if the text suddenly goes italic in an excerpt and doesn’t close before the excerpt cutoff, the rest of my page is completely italic. That doesn’t fly.
How can I get the excerpt cutoff to stop the continuation of a formatting change within the excerpt?
- The topic ‘Want to add wpautop function back into excerpts, along with other tags’ is closed to new replies.