# Latest Comment Teaser Inside Long Posts

> Shows a short quote from the most recent approved comment two thirds of the way through a post, with a link to the discussion.

- Type: Universal
- Runs: Content two thirds
- Category: [Comments](https://wpide.com/library/category/comments/)
- Tags: comments, engagement, social-proof
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/latest-comment-teaser/

## Code

```php
<?php
$wpide_latest = is_single() ? get_comments( array( 'post_id' => get_the_ID(), 'status' => 'approve', 'type' => 'comment', 'number' => 1 ) ) : array();
if ( $wpide_latest ) :
    $wpide_latest = $wpide_latest[0];
    ?>
<blockquote class="wpide-comment-teaser" style="margin:2em 0;padding:1em 1.25em;border-left:4px solid currentColor;opacity:.9">
    <p style="margin:0 0 .5em">&ldquo;<?php echo esc_html( wp_trim_words( wp_strip_all_tags( $wpide_latest->comment_content ), 30 ) ); ?>&rdquo;</p>
    <cite style="font-size:.9em">&mdash; <?php echo esc_html( get_comment_author( $wpide_latest ) ); ?>, <a href="<?php echo esc_url( get_comment_link( $wpide_latest ) ); ?>">read the discussion</a></cite>
</blockquote>
<?php endif; ?>
```

## Notes

Nothing is shown on posts without approved comments.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Latest Comment Teaser Inside Long Posts" in its snippet library and add it in one click; or create a new Universal snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
