Prevent   characters from getting removed by the visual editor
-
I’m a graphic designer and want my
?
(non-breaking space) characters to stay where I bloody-well put them without the visual editor stripping them out again. If you’re a typography dick like me, this is handy to make two or more specific words wrap together rather than breaking at the spaces.For example, if you want “South Australia” not to break in an address.
So, I wrote added a simple shortcode via my child-theme’s functions.php:
//[nbsp] shortcode function nbsp_shortcode( $atts, $content = null ) { $content = ' '; return $content; } add_shortcode( 'nbsp', 'nbsp_shortcode' );
Then I just use:
[nbsp]
Instead of:
Hope this helps someone.
Pt.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Prevent   characters from getting removed by the visual editor’ is closed to new replies.