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?
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
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?
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/
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.
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.