Skip Navigation

[Resolved] Show user info at author archive layout

This support ticket is created 7 years, 1 month 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 5 replies, has 2 voices.

Last updated by Noman 7 years, 1 month ago.

Assisted by: Noman.

Author
Posts
#575241

I need to show some author info at archive page (before list of posts): name, bio, image, etc.

I've tried something like this:
[types usermeta='bio' user_is_author='true' output='raw'][/types]

And it's sometimes working and sometimes not. Looking at reference for this shortcode, it looks that it's not supposed to take user info from archive parameter, but from some post.

Is there any variable that would provide user id at archive page? So I'd use it like this:
[types usermeta='bio' user_id='1'][/types]

#575261

I did it like this meanwhile:

add_shortcode( 'queried_object_id', function( $attr ) {
	return get_queried_object_id();
});

[types usermeta='website' user_id='[queried_object_id]' output='raw'][/types]
#575265

The problem is that it's not working in conditionals (always false):

      [wpv-conditional if="( '[types usermeta='website' user_id='[queried_object_id]' output='raw'][/types]' ne '' )"]  
<li><a href="[types usermeta='website' user_id='[queried_object_id]' output='raw'][/types]" class="face2" title="Website"><i class="fa fa-globe"></i></a></li>
       [/wpv-conditional]  
#575287

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Register Custom Shortcode Function.png

Hi Lina,

Thank you for contacting Toolset support. Please make sure you have register shortcode & function first ‘queried_object_id’ in Toolset >> Settings >> Front-end Content >> Third-party shortcode arguments. And also in >> Functions inside conditional evaluations section -- screenshot attached for example.

If above does not solve the issue, please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and check the issue.

Your next answer will be private which means only you and I have access to it.

=== Please backup your database and website ===

✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.

✙ Please provide Archive page link.

Thank you

#575297

How should I register shortcode at Functions inside conditional evaluations section ?

#575373

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

register.png

Just enter like this: queried_object_id

See attached screenshot.