add shortcode heading showing multiple time

Add a wrapper to your plugin output if ( $rposts->have_posts() ) { $html=”<div class=”pl_recent_posts”>”; $html .= ‘<h3>Recent Posts</h3><ul class=”recent-posts”>’; while( $rposts->have_posts() ) { $rposts->the_post(); $html .= sprintf( ‘<li><a href=”https://wordpress.stackexchange.com/questions/202834/%s” title=”https://wordpress.stackexchange.com/questions/202834/%s”>%s</a></li>’, get_permalink($rposts->post->ID), get_the_title(), get_the_title() ); } $html .= ‘</ul>’; $html .= ‘</div>’; } Create a custom CSS file .pl_recent_posts:not(:first-of-type) h3 { display: none; } And enqueue … Read more