WordPress.org

Ready to get started?Download WordPress

Forums

Portfolio Slideshow
XHTML validation error: 'noscript' element (4 posts)

  1. paultraf
    Member
    Posted 2 years ago #

    Hello,

    I have been trying out Portfolio Slideshow and it works nicely. Thank you. The only issue is that my theme specifies a document type of XHTML1.0 and the W3C Validator complains: document type does not allow element "noscript" here; assuming missing "object" start-tag. I guess it's because the XHTML DTD doesn't allow 'noscript' inside the 'head' element.

    I appreciate the value of the 'noscript' alternative, so I wonder if this code could be moved into the main body? Or might there be some other approach?

    At the end of the day, it's not a big issue, but perhaps there is a simple solution?

    - Paul

    http://wordpress.org/extend/plugins/portfolio-slideshow/

  2. paultraf
    Member
    Posted 2 years ago #

    I delved a bit further and worked out that in portfolio-slideshow.php the function portfolio_head() adds the code as an action to wp_head(). So in my theme functions.php file I removed it: remove_action( 'wp_head', 'portfolio_head');

    Then in a template file I reinserted that code within the body of the page, just before the slideshow itself is inserted. It now doesn't give validation errors. Actually, I'm intending to use it on the home page, where rather than a list of images, I'd just prefer a single image, so in my case I shall probably change the noscript bit accordingly.

    This is the first time I've looked at wp_head, so I don't know if this is appropriate.

    - Paul

  3. Dalton
    Member
    Plugin Contributor

    Posted 2 years ago #

    Hi Paul,
    The plugin is coded against HTML5, where a noscript tag is valid in the header. It's not valid in XHTML, but it works, so we've left it there.

    The problem with your solution is that inserting styles in the body of the document is also invalid, so while it may work (and even validate?) it's not technically correct either.

    I suppose the only truly valid way to do it would be with a script like modernizr, but since every site I've worked on in the last two years has had an HTML5 doctype (including sites using TwentyTen and TwentyEleven) it hasn't been an issue.

    Cheers,
    Dalton

  4. paultraf
    Member
    Posted 2 years ago #

    Hi Dalton,

    Thanks for taking a look at this.

    Yes, you are right and sorry I was mistaken about moving 'noscript' into the body of the document - that gives a validation error also. I think, though, I'll still move the code out of the head section as for this site I shall stick to the XHTML document type.

    But it is a prompt to give more consideration of HTML5 in other projects ...

    - Paul

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic