I am trying to get the authors user_id
on a page linked to by using get_author_posts_url(),
.
For example
http://example.com/author/John%20Smith
where John Smith
is user_id
is 23
. I need to get 23
.
I am trying to get the authors user_id
on a page linked to by using get_author_posts_url(),
.
For example
http://example.com/author/John%20Smith
where John Smith
is user_id
is 23
. I need to get 23
.
Comments are closed.
On an “author” page
get_query_var('author')
will give you the ID.get_queried_object()
will get you considerably more author information.For retrieving custom author data follow the Codex.
First extract the nice name of the author from the author url, then you can get the author then you need to query the
wp_users
table like bellow.