Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A very simple shortcode to clear content following aligned images.
Plugin Name: Clear Aligned Content Shortcode
Description: A way to ensure floated images in page content don't wrap. Use [clear] in editor to push following content below any aligned images.
Author: Mark Root-Wiley
Version: 1.0
Author URI:
Plugin URI:
Place "[clear]" on own line in WordPress editor.
Any content on following lines will appear below any previous aligned images.
add_shortcode( 'clear', 'mrw_clear_shortcode' );
function mrw_clear_shortcode() {
return '<span style="display:block !important; clear:both !important; width: 100% !important; height: 1px !important; border: 0 !important; background: transparent !important;"></span>';
Copy link

mrwweb commented Feb 9, 2018


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment