Skip Navigation

[Resolved] How do I fix these W3 validation errors?

This support ticket is created 7 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Author
Posts
#457679
slider bug.jpg
slider bug w3 error.jpg
slider bug source.jpg
map bug w3 error.jpg
map bug source.jpg

I am trying to: pass W3 validation

I visited this URL: hidden link

I expected to see: no errors

Instead, I got: 2 errors:
1) it's slider error - inline styling. Is there any workaround for this, or maybe i could make another slider as view?

2) It's toolset map styling error. How do I fix these?

#457900

Dear birute,

1) For the second HTML <style> tag, you are right, it is from Toolset maps plugin, you can move it inside <head> tag, for example, add below codes into your theme/functions.php:

remove_action('wp_footer', array( Toolset_Addon_Maps_Common, 'css_fix' ));
add_action('wp_header', array( Toolset_Addon_Maps_Common, 'css_fix' ));

2) For the first HTML <style> tag, it is from the Layouts plugin, file \layouts\classes\cell_types\wpddl.cell_slider.class.php, line 261~270:

function get_inline_style( $unique_id ){
                    ob_start();?>
                        <style>
                            #slider-<?php echo $unique_id ?> .carousel-inner > .item {
                                    height: <?php the_ddl_field('slider_height') ?>px;
                             }
                        </style>
                    <?php
                    echo apply_filters('ddl-get_inline_style', ob_get_clean(), $unique_id );
        }

I don't think there is a way to move it inside <head> tag without hacking this file.
Currently, you can add the "scoped" Attribute into the <style> tag, this should be able to pass W3C validation. for example, add below codes into your theme/functions.php:

add_filter('ddl-get_inline_style', 'inline_style_func', 10, 2);
function inline_style_func($str, $unique_id){
	$str = str_replace("<style>", "<style scoped>", $str);
	return $str;
}

More help:
hidden link

#458313

None of these solutions worked...

I resolved issue by removing Toolset Maps plugin and using simple iframe for Google maps. This will do in this website,

Another problem with slider styling persists, error in W3 changed accordingly, please see screenshot attached.
Maybe i could make kinda view instead that slider? But how do i make that slider, for exaple using custom post's featured img as covering background?

#458369
w3 error slider afeterfix.jpg

Here is screenshot

#458859

Q1) For the second HTML <style> tag from Toolset maps plugin, those PHP codes works in my localhost.

Q2) For the <style> tag from the Layouts plugin, as you can see, the codes is exact same as according to W3C document.
hidden link
But seems W3C validator does not recognize it.

For above both questions, I agree that:
HTML <style> tag should only be outputted inside <header>...</header>, I escalated this thread to our 2nd supporters, check if there is any fix for it.

Q3) For your new question:
Yes, you can make sliders with Views plugin, see our document:
Creating sliders with Views
https://toolset.com/documentation/user-guides/creating-sliders-with-types-and-views/

#462353

Nothing seems to be helping, so i just removed that slider.
Now it's validated, so problem is gone for now...
Thank you for your efforts to help, i really appreciate that.

#462419

Hi,

This is Mohammed, the Toolset support team leader.

I'm posting here to notify you that this issue is already in our internal queues and definitely, we will fix it.

You can always check the changelog page of the Views plugin to know the new features added to our plugins and also to know the fixes: https://toolset.com/download/toolset-views/#changelog

Thanks.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.