DWUser.com

Empowering Web Creativity

EasyRotator KnowledgeBase – WordPress Code Corruption

This page is intended to help developers debug page problems.  If you are not a developer and just received this error while visiting a site, please notify the administrator of that site.  The problem relates to the site's configuration, not to your browser configuration.

Certain plugins and themes modify the default WordPress behavior by changing when the wpautop formatting function runs.  This shreds the rotator code, resulting in the code corruption error you just received.  Fortunately, there's usually an easy fix – simply wrap the [easyrotator] shortcode in [raw]...[/raw] like this:

[easyrotator]erc_11_xxxxxx[/easyrotator]

Becomes:

[raw][easyrotator]erc_11_xxxxxx[/easyrotator][/raw]

This usually solves the problem and will make your rotators render properly.

If The Problem Only Occurs on Search Results

If the problem only occurs on search result pages and not other pages, you can fix the issue by using the Theme Editor (Appearance > Editor) to add the following code to your theme's functions.php file:

// BEGIN EASYROTATOR SEARCH MOD
function easyrotator_search_customization_callback($outerMatches)
{
	$replacementText = '';
	$content = $outerMatches[2];
	$firstImage = stripos($content, '<img');
	if ($firstImage !== false)
	{
		preg_match('|<img.*?\ssrc="([^"]+)"|i', $content, $matches);
		if (is_array($matches) && count($matches) == 2)
		{
			$replacementText .= '<img src="' . $matches[1] . '" class="easyRotatorSearchPreviewImg" />';
		}
	}
	$replacementText .= '<!--easyRotatorSearchPreviewText--></div>';
	return $outerMatches[1] . $replacementText . $outerMatches[3];
}
function easyrotator_search_customization($content)
{
    if (is_search() && in_the_loop())
    {
        $content = preg_replace_callback('|(<!-- Begin DWUser_EasyRotator -->)(.*?)(<!-- End DWUser_EasyRotator -->)|si', 'easyrotator_search_customization_callback', $content);
    }
    return $content;
}
add_filter('the_content', 'easyrotator_search_customization', 1000);
// END EASYROTATOR SEARCH MOD

Add the code at the bottom of the functions.php file, then click Update File to save your changes.

If You Still Experience Trouble

If the [raw] code doesn't work, we recommend disabling plugins one by one until you locate which plugin is the culprit.  If you disable all plugins and the problem persists, then your theme is the source of the problem. In either of these cases, please contact us with details on the problematic plugin or theme so we can investigate a workaround.

If You're Not Using the WordPress Plugin Version

This error message usually only appears when using the WordPress plugin version.  However, it can occasionally occur if you're using EasyRotator for Dreamweaver or the Standalone version.  If you experience this error, first try re-creating the rotator in case there was a problem with the insertion the first time.  If this doesn't solve the problem, the error usually indicates that there's a structural error in the page's code.  To locate and fix the problem, run your page through the W3C validator and correct any reported errors.  If you continue to experience trouble, please contact support and include the URL of your page.

We're Here to Help!

If you have any questions about this article or about using EasyRotator for WordPress, please let us know by opening a support ticket below.

 
Log In
  Reset Password...
 
Why create an account?
  • Manage support tickets and purchases
  • Access to free extensions
  • Special discounts and offers
  • Access to member-only forums
Create Account
100% Spam-Free Guarantee
(Optional)
 

Use the following form to ask a question or submit a support request. An appropriate staff member will reply as soon as possible (usually within a few hours).
Contact Us / Create Support Ticket
 
To attach files, you must Sign Up or Log In.

You have no items in your basket.  Featured products:

XML Flash Slideshow v4 Flash Audio Kit for Dreamweaver

Home | Customer Satisfaction / Refund Policy | Privacy Policy | jQuery Slider | Top of Page

© 2003-2018 DWUser.com / Magnetic Marketing Corp.  All rights reserved.