A thorough testingReasoned about post excerpt rendering for 11 secondsReasoned about post excerpt rendering for 11 seconds
Below is the full revised solution. In this version, we’ve replaced the <p> tag wrapping the excerpt with a <div>, which avoids the double-wrapping caused by WordPress’sbuilt-in wpautop filter on the excerpt. Copy and paste the following code into your theme or plugin: