Disable Auto Format in wordpress

This is a great trick I found today while working on a problem for a client.

What was happening is that wordpress was wrapping her image in paragraph tags and causing it not to float right with text wrapping around it.

The solution was to add this to the functions.php file. (note, make sure you back up your funtions.php file first!)

function my_formatter($content) {
$new_content = '';
$pattern_full = '{(\[raw\].*?\[/raw\])}is';
$pattern_contents = '{\[raw\](.*?)\[/raw\]}is';
$pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);

foreach ($pieces as $piece) {
if (preg_match($pattern_contents, $piece, $matches)) {
$new_content .= $matches[1];
} else {
$new_content .= wptexturize(wpautop($piece));
}
}

return $new_content;
}

remove_filter('the_content', 'wpautop');
remove_filter('the_content', 'wptexturize');

add_filter('the_content', 'my_formatter', 99);

Now you simply add [raw] and [/raw] tags around the element you are having a problem with.

Source

Will Facebook ads still be effective in 2023?

By Dave Fogel | December 20, 2022

Yes, We predict Facebook Ads will still be effective in 2023. Facebook has made several changes to its advertising platform since the iOS 14 update that caused them to lose most of its tracking ability when users left the platform.  Long story short, FB could no longer see where users went after they left the…

Why should you use Google Ads?

By Dave Fogel | December 20, 2022

Google Ads is an advertising platform created by Google that allows businesses to reach potential customers and increase their online visibility. It is a powerful tool that can be used to target specific audiences and promote products and services. Google Ads enables businesses to create engaging ads that can be delivered to the right people…

Why Google Ads is better than Facebook Ads

By Dave Fogel | December 19, 2022

Google Ads offers businesses a number of advantages over Facebook Ads. Google Ads allows businesses to target specific locations and audiences, allowing them to reach the people that are most likely to be interested in their services. Additionally, Google Ads offers businesses more control over their campaigns, allowing them to adjust their campaigns in real-time…

Posted in

Dave Fogel

Leave a Comment