0

I implemented author vcard in my wordpress single post fine with the following code:

<span class="vcard author"><span class="fn"> Written by: <Admin rel="author"><?php the_author() ?> </Admin> </span></span>

But when i check the web page with w3c validator it gives the error:

Element admin not allowed as child of element span in this context. (Suppressing further errors from this subtree.)

What should i change?

Umair
  • 89
  • 1
  • 10

2 Answers2

0

This is a nesting error, basically it means that the validator does not comprehend the structure you've made either try to remove the nesting of admin or remove the <Admin> all together.

Here's some info:

How to fix: Element div not allowed as child of element ul in this context. (suppressing further errors from this subtree.)

Hope it helps.

Community
  • 1
  • 1
wertons
  • 24
  • 1
  • 4
  • I am a rookie so I need more elaboration. How can i remove the nesting of admin? Is there any replacement? – Umair Apr 25 '18 at 06:17
  • As DIDIx13 said `` isnt a HTML tag, so maybe the error is there. If you want to define the author as a value you can use pretty much any HTML5 tag, just include the `rel="author"` inside it. Try this code ` Written by: ` – wertons Apr 25 '18 at 06:43
0
  1. <Admin> doesn't exist in HTML, you should remove it.

You can replace it with a <p> who defines a paragraph.


  1. You have two <span> following each other with different classes. Is it intended?

You can use multiple classes in one tag: <span class="fn vcard author">


Sources

Didix
  • 567
  • 1
  • 7
  • 26