Skip Navigation

[Resolved] [get_author_id_in_archive] always return 0

This support ticket is created 5 years, 4 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 5 years, 3 months ago.

Assisted by: Christian Cox.

Author
Posts
#1309617

Hi,
I try to create a messaging system and I follow this tutorial: https://toolset.com/learn/how-to-create-a-messaging-system-with-toolset/

Last step is to create and register shortcode "get_author_id_in_archive". At the end messaging system don't work becouse it not get ID for "Message to".

I just test this shortcode by put it in regular post, and shortcode return always 0.
I copy this function to another website and also shortcode return 0.

#1309637

Hi, that shortcode is only designed to work inside an Author archive page. Have you created an Author archive? If you place the shortcode there, does the correct User ID appear?

#1310221

Oops I did not use it on Author archive page.
But also I don't want use it on Author archive page.
If new message form is on post page I schould use this [wpv-post-author format='meta' meta='ID] shortcode?

#1310493

Yes but I think you're missing a quotation mark. Here's an update:

[wpv-post-author format='meta' meta='ID']