HELP with W3C Validator |
HELP with W3C Validator |
temeter |
Feb 7 2019, 10:15 AM
Post
#1
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
Hello.
A friend of mine have a website and we want to check it and validating for errors (WCAG 2.0 AA). So, when I check it in https://validator.w3.org I got some errors like above: ERROR1: ------------Element head is missing a required instance of child element title.---------- From line 1, column 736; to line 1, column 742 d/atom/"/></head>< Content model for element head: If the document is an iframe srcdoc document or if title information is available from a higher-level protocol: Zero or more elements of metadata content, of which no more than one is a title element and no more than one is a base element. Otherwise: One or more elements of metadata content, of which exactly one is a title element and no more than one is a base element. ERROR2: ------------link element between head and body.------------- From line 1, column 743; to line 1, column 914 "/></head><link type="text/css" media="all" href="https://www.yourphysiopath.gr/wp-content/cache/autoptimize/css/autoptimize_365c6b81cd9cf8d3a27dc3e25a4b9a5e.css" rel="stylesheet" /><link ERROR3: ------------Cannot recover after last error. Any further errors will be ignored.---------------- From line 1, column 743; to line 1, column 914 "/></head><link type="text/css" media="all" href="https://www.yourphysiopath.gr/wp-content/cache/autoptimize/css/autoptimize_365c6b81cd9cf8d3a27dc3e25a4b9a5e.css" rel="stylesheet" /><link The website is Wordpress site. I have tried several plugins to fix them and some edit in header.php but I can't find anything else. Where I can find those html codes to fix them? In which wordpress file/s? Can you help please? Thank you. |
Christian J |
Feb 7 2019, 10:44 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
Hello!
ERROR1: ------------Element head is missing a required instance of child element title.---------- The above sounds like the TITLE element is missing in the HEAD section. QUOTE ERROR2: ------------link element between head and body.------------- LINk elements can only be in the HEAD section (in fact no HTML elements are allowed between HEAD and BODY). QUOTE The website is Wordpress site. I have tried several plugins to fix them and some edit in header.php but I can't find anything else. Where I can find those html codes to fix them? In which wordpress file/s? My guess would be inside header.php. But I'd assume especially TITLE should be easy to edit in Wordpress. |
temeter |
Feb 7 2019, 11:15 AM
Post
#3
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
Hello Christian_J
Thank you for your reply. Yes I have checked header.php code but I'm not sure what else files to check that would have the errors inside them Maybe I will upload the code from the header.php file so we can check it more good. Sorry for my English. Thanks. |
Christian J |
Feb 7 2019, 01:34 PM
Post
#4
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
|
temeter |
Feb 8 2019, 06:34 AM
Post
#5
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
Hello.
Ok I understand, thanks So, here is the code from header.php file: <!DOCTYPE html> <!--[if IE 7]><html class="ie ie7" <?php language_attributes(); ?>><![endif]--> <!--[if IE 8]><html class="ie ie8" <?php language_attributes(); ?>><![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!--><html <?php language_attributes(); ?>><!--<![endif]--> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="profile" href="http://gmpg.org/xfn/11"> <meta name="format-detection" content="telephone=no"/> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'rss2_url' ); ?>"/> <link rel="alternate" type="application/atom+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'atom_url' ); ?>"/> </head> <?php if ( is_singular() && pings_open( get_queried_object() ) ) { ?><link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"><?php } ?> <?php wp_head(); ?> <body <?php body_class(); ?>> <div id="page"> <?php get_template_part( INSPIRY_PARTIALS . '/header/header' ); ?> |
pandy |
Feb 8 2019, 10:05 AM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
Yeah, Christian was right. There is no TITLE. And here's the misplaced LINK.
CODE </head> <?php if ( is_singular() && pings_open( get_queried_object() ) ) { ?> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php } ?> <?php wp_head(); ?> <body <?php body_class(); ?>> |
temeter |
Feb 8 2019, 11:29 AM
Post
#7
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
Hello Pandy and thank you for your answer
Hmm, so I have to insert Title tag inside head. But the code that is out of the Head tag (this one you sent me) have to be inside the Head tag, right? |
Christian J |
Feb 8 2019, 11:30 AM
Post
#8
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
To get the TITLE element back, you might use something like this (somewhere between the <head> and </head> tags):
CODE <title><?php wp_title(); ?> - <?php bloginfo( 'name' ); ?></title> but I'm not sure if this is considered "best Wordpress practices". |
Christian J |
Feb 8 2019, 11:32 AM
Post
#9
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
the code that is out of the Head tag (this one you sent me) have to be inside the Head tag, right? Yes, I think you should put this before the </head> tag: CODE <?php if ( is_singular() && pings_open( get_queried_object() ) ) { ?> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <?php } ?> <?php wp_head(); ?> |
temeter |
Feb 8 2019, 11:34 AM
Post
#10
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
Hey Christian
Ok I will try it and I will inform about it. Thank you. |
temeter |
Feb 8 2019, 11:52 AM
Post
#11
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
Ok, I have tried but nothing yet
Now with this code it gives me 2 errors and 4 warnings. Before was only 3 errors. The code now: <!DOCTYPE html> <!--[if IE 7]><html class="ie ie7" <?php language_attributes(); ?>><![endif]--> <!--[if IE 8]><html class="ie ie8" <?php language_attributes(); ?>><![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!--><html <?php language_attributes(); ?>><!--<![endif]--> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="profile" href="http://gmpg.org/xfn/11"> <meta name="format-detection" content="telephone=no"/> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'rss2_url' ); ?>"/> <link rel="alternate" type="application/atom+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'atom_url' ); ?>"/> <?php if ( is_singular() && pings_open( get_queried_object() ) ) { ?><link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"><?php } ?> <?php wp_head(); ?> <body <?php body_class(); ?>> </head> <div id="page"> <?php get_template_part( INSPIRY_PARTIALS . '/header/header' ); ?> Christian the Title tag didn't worked Maybe something else it is. I can't fully understand it. |
Christian J |
Feb 8 2019, 12:09 PM
Post
#12
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
|
temeter |
Feb 8 2019, 12:15 PM
Post
#13
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
Ok I have done what you said me and now the validator says:
Element title not allowed as child of element head in this context. (Suppressing further errors from this subtree.) |
temeter |
Feb 8 2019, 12:19 PM
Post
#14
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
All these errors comes only from header.php file? Maybe the problem is also in another file, I don't know
|
Christian J |
Feb 8 2019, 01:37 PM
Post
#15
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
Ok I have done what you said me and now the validator says: Element title not allowed as child of element head in this context. (Suppressing further errors from this subtree.) That sounds strange. Can you post a code example of it again please? Also please post the HTML code of the HEAD section (that the validator sees, as opposed to the PHP code). |
temeter |
Feb 9 2019, 01:57 PM
Post
#16
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
Ok the code now is:
<!DOCTYPE html> <!--[if IE 7]><html class="ie ie7" <?php language_attributes(); ?>><![endif]--> <!--[if IE 8]><html class="ie ie8" <?php language_attributes(); ?>><![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!--><html <?php language_attributes(); ?>><!--<![endif]--> <head> <title><?php wp_title(); ?> - <?php bloginfo( 'name' ); ?></title> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="profile" href="http://gmpg.org/xfn/11"> <meta name="format-detection" content="telephone=no"/> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'rss2_url' ); ?>"/> <link rel="alternate" type="application/atom+xml" title="<?php bloginfo( 'name' ); ?>" href="<?php bloginfo( 'atom_url' ); ?>"/> <?php if ( is_singular() && pings_open( get_queried_object() ) ) { ?><link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"><?php } ?> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <div id="page"> <?php get_template_part( INSPIRY_PARTIALS . '/header/header' ); ?> I hope you mean this code If not please let me know what code you want to see. Thank you a lot. |
Christian J |
Feb 9 2019, 05:12 PM
Post
#17
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
Can you also post the HTML code that web browsers see? You can view it by loading the page in a browser and press Ctrl+U (in Windows). Maybe you can also see the full source on the validator page. The HTML for the HEAD section should be enough.
|
pandy |
Feb 9 2019, 11:42 PM
Post
#18
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,716 Joined: 9-August 06 Member No.: 6 |
Or simpler just link to the the page so we can see for ourselves.
The title is in the right place in the template, so this last error is a little odd. |
Christian J |
Feb 10 2019, 05:01 AM
Post
#19
|
. Group: WDG Moderators Posts: 9,630 Joined: 10-August 06 Member No.: 7 |
Maybe the PHP functions wp_title() or bloginfo( 'name' ) are not supported by this WP configuration, and outputs something invalid. In that case I probably cant't help much, since I don't have WP experience. I suppose you could enter the TITLE text manually, but that defeats the purpose of using WP in the first place.
|
temeter |
Feb 11 2019, 06:25 AM
Post
#20
|
Newbie Group: Members Posts: 17 Joined: 7-February 19 Member No.: 26,819 |
Hello my friends
Sorry for the delay. Ok here is the website link: https://www.yourphysiopath.gr As I saw my self many code in the head section. I don't know what is the problem. Ok Christian no problem I understand fully and thank you both for your help I'm waiting for your reply Thank you a lot. |
Lo-Fi Version | Time is now: 29th March 2024 - 12:53 AM |