"In Short" Plain-Language Summary Above Posts
Shows the post's excerpt in a highlighted "In short" box at the top of single posts, giving every reader, including people with reading or cognitive disabilities, a simple summary before the full text.
Opens WPIDE on
Code
if ( is_singular( 'post' ) && has_excerpt() ) {
printf(
'<aside class="wpide-in-short" aria-label="Summary" style="margin:0 0 1.5em;padding:14px 18px;border-left:4px solid #2271b1;background:#f0f6fc;border-radius:4px;"><p style="margin:0 0 .25em;font-weight:700;">In short</p><p style="margin:0;">%s</p></aside>',
esc_html( get_the_excerpt() )
);
}
Notes
Only hand-written excerpts are shown (posts without one show nothing), so write them in short, simple sentences.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.