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

Are Google Ads Pay Per Click?

By Dave Fogel | December 2, 2022

Yes, Google Ads operates on a pay-per-click (PPC) basis. This means that businesses will pay for each click that is generated by their ads. The cost of each click will depend on the type of campaign and the targeting options selected. Google Ads also offers businesses access to powerful analytics and reporting tools, allowing them…

Why would someone use Google Ads instead of Facebook Ads?

By Dave Fogel | November 28, 2022

Let’s talk about Google Ads and Facebook Ads.  Each has its own pluses and minuses.  Here is how we see it. Google Ads is intent-based. What does intent-based mean? Simply put, people know what they are searching for and are going to find it. For example, if I am looking to tint my car, I…

What is Search Engine Optimization? Will a Plug-in Do it For me?

By Dave Fogel | September 3, 2020

Search Engine Optimization or SEO is the process of optimizing your website for keywords related to your business—for example, Jacksonville Web Design Company. It involves added your keywords in the page title, descriptions, and strategically in the content. That part of the process is called on-site optimization. The other part of SEO is called Off-page…

Posted in

Dave Fogel

Leave a Comment