This is probably a super simple question.
But how do I echo the ID of a user on author.php?
I’ve tried
the_author_meta('ID')
But it didn’t seem to want to work. I want to echo it at the end of a URL, for example;
http:///www.domain.com/author/sampleauthor-id
Obviously, where “id” is that particular author’s ID
Any ideas?
Try this code.
Alternatively, if author name has not been set use:
credit @AndyAdams in the easily missed comments bellow
Try this simply code
if
var_dump(the_author_meta('ID'))
is Null your author has no posts.Try use echo
$author
if you call it insideauthor.php