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

Once my new website is live, how do I get on Google?

By Dave Fogel | September 3, 2020

After your website is live, we will submit your website to be crawled or indexed by Google. You will see it appear typically in a few weeks. If you are looking to get on the first page of Google, you will need search engine optimization.

What is involved in selling things online? (e-commerce)

By Dave Fogel | September 3, 2020

There are many options out there for e-commerce websites. WordPress/WooCommerce, Shopify, 3d Cart, Big Commerce, and many more. We have experience working with the most popular ones. They all have their advantages and disadvantages. While WooCommerce is free to download, there are many paid add-ons required to start selling products online. You will need a…

What about Website Hosting?

By Dave Fogel | September 3, 2020

When you have a website, it needs to live somewhere on the web – this is what website hosting is. Website hosting can range anywhere from $3 a month to $99+. Not all website hosting is created equal. Budget hosting plans from places like Hostgator or Go Daddy get the job done … barely. You…

Posted in

Dave Fogel

Leave a Comment