• Resolved mcfreder

    (@mcfreder)


    Hello,

    As you can tell from the title this is the only error that this plugin displays on my webmaster tools.

    To fix it, first off check the code source of yourwebsite.com/post-title-name?amp

    Then look for this attribute style=”” inside your a div or p tag.

    In my case i found the following:

    style=”text-align: center;”

    Then all I had to do to remove ‘style=”text-align: center;”‘ from every page, is to add the following filter code in wp-content/plugins/accelerated-mobile-pages/themes/default/functions.php

    function replace_content($content)
    {
    $content = str_replace('style="text-align: center;" ', '',$content);
    return $content;
    }
    add_filter('the_content','replace_content');

    I hope this will be of any help.

    https://www.ads-software.com/plugins/accelerated-mobile-pages/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fix Style attribute can not appear in div or p’ is closed to new replies.