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
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
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