Current post’s author name in the author meta tag

Question

I am trying to add the current post’s author as the content for the meta author tag. I wrapped this particular meta in an is_single condition and then tried:

<meta name="author" content="<?php get_the_author(); ?>" />

as well as tried this:

<meta name="author" content="<?php the_author(); ?>" />

For both the above, Facebook debugger responded with:

Meta with name instead of property : The meta tag on the page was specified with name ‘author’, which matches a configured property of this object type. It will be ignored unless specified with the meta property attribute instead of the meta name attribute.


Then I tried:

<meta property="article:author" content="<?php the_author(); ?>" />

as well as tried this:

<meta property="article:author" content="<?php the_author(); ?>" />

For both the above, Facebook debugger responded with:

Parser Mismatched Metadata : The parser’s result for this metadata did not match the input metadata. Likely, this was caused by the data being ordered in an unexpected way, multiple values being given for a property only expecting a single value, or property values for a given property being mismatched. Here are the input properties that were not seen in the parsed result: ‘article:author’.


What am I doing wrong as all of the above four metas just return a blank content (<meta name="author" content/>) for the author tag.

0
, , , AndrewL64 2 years 2020-01-03T08:39:02-05:00 0 Answers 101 views 0

Leave an answer

Browse
Browse