• Resolved mgorzka@curtislibrary.com

    (@mgorzkacurtislibrarycom)


    Hello all,

    When I try to validate the page that Meta Slider is installed on (XHTML transitional), I get this validation error:

    Line 113, Column 27: document type does not allow element “style” here

    <style type="text/css">

    Here’s how it appears within the markup on that page:

    <!-- meta slider -->
    <div style="max-width: 850px;" class="metaslider metaslider-flex metaslider-24304 ml-slider">
    <style type="text/css">
    @import url('http://www.curtislibrary.com/wp-content/plugins/ml-slider/assets/metaslider/public.css?ver=2.3.1');
    @import url('http://www.curtislibrary.com/wp-content/plugins/ml-slider/assets/sliders/flexslider/flexslider.css?ver=2.3.1');
    </style>
    <div id="metaslider_container_24304">
    <div id="metaslider_24304" class="flexslider">
    <ul class="slides">
    <li style="display: none;"><a href="http://www.curtislibrary.com/25186-2/"><img src="http://www.curtislibrary.com/wp-content/uploads/2013/08/other-creator-rotating-gallery-bill1.jpg" height="360" width="850" alt="Bill Burke" class="slider-24304 slide-24762" /></a>
    <li style="display: none;"><a href="http://www.curtislibrary.com/24862-2/"><img src="http://www.curtislibrary.com/wp-content/uploads/2013/08/other-creator-rotating-gallery-maria1.jpg" height="360" width="850" alt="Maria Castellano-Usery" class="slider-24304 slide-24763" /></a>
    
    </div>
    </div>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Mike

    http://wordpress.org/plugins/ml-slider/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Mike,

    XHTML is quite an old specification (2001) and is pretty strict, Meta Slider won’t (and probably won’t ever) output valid XHTML. The tradeoff of putting the style tags into the header of every page (not just the ones meta slider is on) is too great to achieve compatibility with an old standard.

    But, HTML5 (2012) is more standard nowadays. You can achieve HTML5 compatibility by adding this to your themes functions.php file:

    function ms_scoped() {
        return ' scoped';
    }
    add_filter('metaslider_style_attributes', 'ms_scoped', 25, 3);

    Regards,
    Tom.

    Thread Starter mgorzka@curtislibrary.com

    (@mgorzkacurtislibrarycom)

    I’ll; do that – Thanks, Tom!

    I have the same issue and when I put the above code in my functions.php file it broke the entire slider.

    As per the Forum Welcome, please post your own topic.

    matchalabs

    (@matchalabs)

    Just posting this for anyone who has found this thread on Google.

    I’ve been working on a plugin to move the Meta Slider link, inline script and style blocks into the <head> of the page:

    https://github.com/tomhemsley/ml-slider-html5

    To install, click ‘Download ZIP’, then go to Plugins > Add New > Upload and select the .zip file. So far there isn’t a settings page or anything like that.

    If you’re using this plugin, please let me know how it goes! I may integrate the functionality into the Meta Slider plugin if it’s working well

    Regards,
    Tom

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Meta Slider v. 2.3.1 xhtml validation error’ is closed to new replies.