I've been using this great snippet from Jean-Baptiste Jung to output raw HTML with a shortcode. However I've realized that this sometimes interferes with the output of other plugins - wpautop and wptexturize are applied wrongly sometimes.
So I tried re-writing the snippet with the shortcode API. Here's what I got so far:
function raw_html($atts, $content = null) {
remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');
return $content;
}
add_shortcode('raw', 'raw_html');
Unfortunately it doesn't work. Any help would be appreciated. Thanks!
relaxedguy
Member
Posted 1 year ago #
Here's one solution as a plugin ML Raw HTML . I'd rather add this to my custom_functions.php file in Thesis theme and avoid adding another plugin though.
relaxedguy
Member
Posted 1 year ago #
Few other plugins http://wordpress.org/extend/plugins/raw-html/ and
http://www.wordpress-plugin.org/tag/raw-html/
Second one inserts short codes by using the shortcodes in raw html mode or via a button in the TinyMCE visual editor toolbar. Going to try these all out and report back.
Thanks relaxedguy! The ML Raw HTML plugin did the trick. And you're right, I might just add this to my functions.php file :)
The 2nd one makes use of the snippet I linked to - wpautop and wptexturize are applied wrongly sometimes.
relaxedguy
Member
Posted 1 year ago #
Turns out ML Raw didn't work for me. I'm going to hunt down a tinyMCE button for this. All I want to do is be able to add one or more <div class="clear"></div> to posts to keep text flowing around left and right-aligned images correctly. I seem to have some of my footer social buttons creeping up into posts unless I add these divs and I hate pasting in the div in raw html and then publishing from there without seeing in rich-text mode.
jivyb
Member
Posted 11 months ago #
What did you end up with, relaxed? I am looking for something to let me put raw html in parts of pages too. The http://wordpress.org/extend/plugins/raw-html/ one sounds great, but when I add the shortcode to code that's working fine, it actually breaks the page.
Anything out there actually work? Just want to protect sections of my page so a client can use the wysiwyg.