Problem: I would like to show information about the Author being shown in the Author archive page.
Solution: In most cases, the wpv-post-author shortcode is used to display information about the current Author. However in this site setup, the wpv-post-author shortcode does not behave as expected in the Author archive. This may be a result of the custom theme or another active plugin. Please add this custom shortcode to your theme's functions.php file:
function get_author_id_in_archive_func($atts) { $author_id = 0; if (is_author()){ $author = get_queried_object(); $author_id = $author->ID; } return $author_id; } add_shortcode("get_author_id_in_archive", "get_author_id_in_archive_func");
Go to Toolset > Settings > Frontend content and add "get_author_id_in_archive" in the "Third-party shortcode arguments" input field.
Then you can use the shortcode in your Author Archive Layout Visual Editor cell or WordPress Archive cell to supply the Author's User ID to a wpv-user shortcode:
Author ID: [get_author_id_in_archive]<br /> Author first name: [wpv-user id="[get_author_id_in_archive]" field="user_firstname"]<br /> Author last name: [wpv-user id="[get_author_id_in_archive]" field="user_lastname"]<br /> Author custom field: [wpv-user id="[get_author_id_in_archive]" field="wpcf-fieldslug"]<br /> Author profile picture: [wpv-user id="[get_author_id_in_archive]" field="profile_picture" size="100"]<br />
Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-user
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-author
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 13 replies, has 3 voices.
Last updated by 6 years, 10 months ago.
Assisted by: Christian Cox.