- This topic has 9 replies, 2 voices, and was last updated 6 months, 1 week ago by
David.
-
AuthorPosts
-
August 11, 2020 at 1:31 am #1396655
limolab
Hello. as you can see in the title i really need to remove this line:
<!–googleon: all–><style type=”text/css” media=”screen”></style>in source code: line 848.
i think that this is generate in generate_after_footer part.
but i really don’t know how to remove it. i really need it for w3c validator
Can you help me?
Thanks.
LimoAugust 11, 2020 at 4:47 am #1396884David
StaffCustomer SupportHi there,
that is not part of theme. I would expect it has been added Cookie law plugin as it sits between the
googleoff
andgoogleon
meta tags. You would need to speak to the plugin developer.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 11, 2020 at 8:29 am #1397349limolab
Hello, thanks for your quick reply.
My mistake the line is: 775<style type=”text/css” media=”screen”></style>
Thanks.
August 11, 2020 at 10:37 am #1397541David
StaffCustomer SupportThats not related to the theme either. Apart from it NOT containing styles i cannot see as an Error in W3C validator.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 19, 2020 at 3:29 am #1409150limolab
Hello, i’ve disabled all plugins but the <style> is still there.
i really don’t know how to hide it.
I’ve tried with javascript but the w3c still read it.
—-
Do you have any advice?
Thanks.August 19, 2020 at 4:18 am #1409204David
StaffCustomer SupportDo you have any custom functions or any Hooks containing code ?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 19, 2020 at 5:34 am #1409296limolab
yes, i have a custom function.
——————————-
<?php
/**
* GeneratePress child theme functions and definitions.
*
* Add your custom PHP in this file.
* Only edit this file if you have direct access to it on your server (to fix errors if they happen).
*/function generatepress_child_enqueue_scripts() {
if ( is_rtl() ) {
wp_enqueue_style( ‘generatepress-rtl’, trailingslashit( get_template_directory_uri() ) . ‘rtl.css’ );
}
}
add_action( ‘wp_enqueue_scripts’, ‘generatepress_child_enqueue_scripts’, 100 );add_action(‘generate_inside_navigation’, ‘db_custom_navigation_search’, 10);
add_action(‘generate_inside_mobile_header’, ‘db_custom_navigation_search’, 10);
function db_custom_navigation_search() {
printf(
‘<form method=”get” class=”search-form custom-nav-search” action=”%1$s”>
<input type=”search” class=”search-field” value=”%2$s” name=”s” title=”%3$s” placeholder=”%3$s”></form>’,
esc_url( home_url( ‘/’ ) ),
esc_attr( get_search_query() ),
esc_attr_x( ‘Search’, ‘label’, ‘generatepress’ ),
generate_get_svg_icon( ‘search’ )
); echo ‘‘;
}/* FUNZIONE PER TOGLIERE IL CUSTOMIZE DEL TEMA */
add_action( ‘after_setup_theme’, ‘tu_remove_dynamic_css’ );
function tu_remove_dynamic_css() {
remove_action( ‘wp_enqueue_scripts’, ‘generate_enqueue_dynamic_css’, 50 );
}/* TOGLI IL TYPE DA SCRIPT E STYLE */
add_action(
‘after_setup_theme’,
function() {
add_theme_support( ‘html5’, [ ‘script’, ‘style’ ] );
}
);August 19, 2020 at 6:03 am #1409340David
StaffCustomer SupportHmmm – i can’t see that would create the empty
<style>
tag – can you ‘disable’ the childthemes functions.php ( simply remove the code to somewhere safe ) to test.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 19, 2020 at 6:09 am #1409348limolab
hello, i have done it, but nothing changed.
I really don’t know what to do..August 19, 2020 at 7:14 am #1409443David
StaffCustomer SupportAre you using any Hook Elements ?
https://docs.generatepress.com/article/hooks-element-overview/
Check in there to make sure there isn’t any code.If not then the only other way to remove it is to look for it in your database.
Or just ignore it – W3 is only warning you of the use of the styles attribute – not the empty content.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.