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.
Hello!
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.
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' ); ?>
Yeah, Christian was right. There is no TITLE. And here's the misplaced LINK.
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?
To get the TITLE element back, you might use something like this (somewhere between the <head> and </head> tags):
Hey Christian
Ok I will try it and I will inform about it.
Thank you.
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.
This part:
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.)
All these errors comes only from header.php file? Maybe the problem is also in another file, I don't know
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.
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.
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.
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.
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.
There are two TITLE elements, only one is allowed.
You have two instances of TITLE. The validator complains about the second and redundant one. Where that one comes from...
These two errors I don't understand.
I changed doctype and removed the XHTML slashes so I could validate with our validator. It doesn't complain about those last two errors.
It's something in the embedded JavaScript that makes the validator think there's something amiss with </head> and <body> .
Sorry, Christian. I didn't see your reply about the duplicate TITLE.
BTW the server for https://www.yourphysiopath.gr/ responds very slowly.
Yes, very.
Ah, I didn't see that link. Odd though, when I removed the script blocks the errors went away.
I also should add that there are more validator errors showing up, after you fix the first ones. I don't know the quality of today's Wordpress HTML code, maybe some of it is not worth fixing all of it.
Hello
Any news? Did you saw the code of the website?
Thank you.
Sorry I didn't show the page 2
Hmm ok I see.
What do you propose to do? Because I do not have the knowledge to solve all these problems. Should I hire someone to make them? If I create an administrator account can any of you solve the problems? With the corresponding payment of course. Otherwise, is there anything I can do for myself to fix these problems?
If you are going to pay for help it's probably better to get someone who is used to WordPress. And good at web standards. It might be hard to find one that are good at both though.
If the site works as it should, I would just correct what's easily corrected errors and leave the rest. If you find 10 WordPress sites and validate them, I bet you none of them will be without errors and most will have more than your site.
Found this list by a WP lover of blogs that use WP. I did just a few, but those were full of errors.
https://www.wpexplorer.com/name-brands-use-wordpress/
Check a few of them for errors and I think you'll see what you are up against. There's WP itself, then there are third party templates that may add even more errors and in most cases probably do...
Ok Pandy I see
Yes you are right, I understand fully and I think the same way too.
Ok then, I will think what I can do. If I find a good solution I will let you know.
Thank you a lot both of you for your help. Have a nice day
You too. And good luck.
Thank you
Hello my friends.
Finally the problems (errors) of the website resolved. I hired someone to fix them and everything ok now.
I want to thank you very much for your help here. I hope to be well
Have a nice day!
You are welcome. Sorry we couldn't help more.
No problem. Even what you did and give some help is very important
Thanks.
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)