Skip Navigation

[Resolved] Get the ID of author of the archive author page

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 3 voices.

Last updated by Shane 6 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#907343

As described in topic, please let me know if there's a way to obtain the author ID of the author archive page.

Maybe it's a stupid question .....

#907384

No question is stupid 🙂

A user in an author archive will be always the author of the displayed posts.
Hence, to display the "author" of the author archive you can simply add the Post Author shortcode to the Archive's loop.
[wpv-post-author]

Since the post author is always just one, on an archive page for authors, this will always show the name of the currently viewed author.

Or the [wpv-archive-title] as well works, since this will output something like:
AUTHOR: AUTHOR_NAME

To display just the ID of the author, the last ShortCode won't work.
For that, the first ShortCode is to be used, bypassing an additional attribute:
[wpv-post-author format="meta" meta="ID"]

This will then output the Author ID, instead of the Name.
This can be inserted using the "Fields and Views" button you can find in the archives loop editor.

This here is the DOC for above 2 shortcodes
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-154504
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-295335

#907386

Thank you,

but my problem is that I need the ID of the author into a view inside the author archive page.

I need this ID to filter all the author post of a specific custom post type....

So I don't have any post to obtain the ID of the author.

Instead I try to white a shortcode that use the get_user_by( 'slug', $author_name ) wordpress function using the slug in the url as parameter.

I don't know if it's correct but it 's work...

#907590

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Christian,

If I follow correctly on an author archive page you want to display information of a specific post type correct?

Please let me know.

Thanks,
Shane

#908778

Basically I need to have a page for each "author" that can be "linkable". Something like "xxxxx.com/author/user1".
I have a lot of users and every of them has your own page. I think that I must use the author archive page for that right ?
In this page I want to show a view of the custom post type articles of this author.

Now I want to show also the "type usermeta" info about the author that I build. I created some type usermeta fields like description, city, nation nad so on related to the author.

But now, after the last wp-types update, I can't show this info with the shortcode [types usermeta='description' user_id="xx"][/types] ! (I'm sure that I have some content in description for the user xx)
please let me know why!

Thank you!

#908980

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Cristian,

So you want to have a page that lists all the authors. Then each of those authors are linked to their specific author page correct?

If you can show me a visual representation of what you want to achieve then I should be able to assist better.

Thanks,
Shane

#908989

Thank you.

Yes we have the list of all the authors. Each author has your own page (author archive page). Into this page I want to show all the specific custom post type of the author.
We don't have a "normal" wordpress posts only custom post type posts.

I have 2 problem:
1. into the author archive page I can't have the ID of the author ( now I get this with a custom shortcode)
2. The author archive page don't show me the custom user meta field [types usermeta='description' user_id="xx"][/types] even if I specify the user ID.

#909001

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Cristian,

Would you mind providing me with access so that I can take a look at this for you ?

The private fields will be enabled for your next response.

Thanks,
Shane