Home › Toolset Professional Support › [Resolved] I wanna display the name and the user field on the author's page without post.
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.
Our next available supporter will start replying to tickets in about 3.25 hours from now. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | 10:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Kolkata (GMT+05:30)
Tagged: Views plugin, WordPress Archives
Related documentation:
This topic contains 13 replies, has 2 voices.
Last updated by Minesh 7 years, 1 month ago.
Assisted by: Minesh.
I want to make an author's profile page. I also want to display profile of authors who have not yet posted.
However, if there is no posting, nothing is displayed on the author page.
Displayname could be displayed with the following question. But how can I display User Fields created using Toolset?
* Questions that have been taught the same things so far
[Question]
https://toolset.com/forums/topic/show-wpv-user-attributes-in-author-archive-page-when-users-havent-got-any-post/
Specifically, I would like to always display the author name and the User Field with slug "item-a" on the following page even if there is no posting.
hidden link
According to the previous [Question], I think that it is necessary to code the short code in functions.php.
I can hardly use PHP, so please show me how to write a short code.
Also, the author's archive is made with WordPress Archive of Toolset, but please tell me where to write the shortcode. Is it in the editing area of Filter Editor?
It may be the same question as [Question]. I'm sorry.
But I am in a hurry and are in great trouble.
Could you please tell me?
Hello. Thank you for contacting the Toolset support.
Well - we have details Doc available how you can customize the user profile as well as add user fields to it.
To output the user fields created with Types, use the following function:
echo types_render_usermeta("custom-field-slug-name", array("argument1″=>"value1″,"argument2″=>"value2″,"argument2″=>"value2"));
More info:
=> https://toolset.com/documentation/customizing-sites-using-php/creating-custom-user-profiles/
=> https://toolset.com/documentation/customizing-sites-using-php/functions/
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-user
Thank you.
Does that way display data without posting?
I am in trouble with what user data is not displayed when there is no post.
I am indeed in trouble, I am in a hurry.
Has the meaning of my question been communicated to you?
I am sorry I can not use English.
Well - you need to guide me what data you want to display and where with problem URL after that I will investigate and let you know what neeeds to be done.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
You can change the training site in any way.
Thank you.
Well - I see you have separate ticket with your [question] and Christian is helping there.
Thanks for sharing access details but I'm still not clear what issue you are facing.
[A page on which data can be displayed because there are posts.]
hidden link
==> OK I understand and I can see the content it displays.
[A page on which data can be displayed because there is no post.]
hidden link
==> OK I understand and I can not see values for most of the fields but I can see the author name where you used shortcode [get_user_display_name] to display to user name.
Do you mean that you want to display username with your training site?
=> hidden link
Thank you for checking.
With the help of Christians, I was able to display "DisplayName" without posting.
I have other data I want to display. It is "UserField" created with Toolset.
Please look at the training site.
There is a "User Field Group" named "Sample" in the "User Field".
There is an item named "Item A".
How can I display "Item A" even if there is no posting?
In addition, it is more helpful to have conditional statements that can be displayed only when "Display item A" is "Yes".
The attached image shows this.
What should I do?
Well - I need training site access details to check on training site. Could you please share it.
I have set the next reply to private which means only you and I have access to it.
Could you please check with your training site here:
=> hidden link
I added the display item A and Item A values so you able to know how to display those values but to conditionally check those values we need to chose different way and need to build custom shortcode and for that I need test site where I can access functions.php file of theme and add such custom shortcode.
Thank you very much!!!
I prepared an environment close to production environment.
I wrote the login information as "Additional Information" in private ticket #576419.
You can change this site any way.
I want to know how can I write here.
hidden link
For example, this site have
--------------------------------------
User Field Group "Sample"
Field "Display item A","Item A"
--------------------------------------
Would not you make samples for this?
Could you please check now. I've added following shortcode to your theme's functions.php file:
function func_display_user_fields($atts,$content) { global $post; return wpv_do_shortcode("[types usermeta='display-item-a' user_name='[wpv-user field='user_login']'][/types]"); } add_shortcode( 'get_user_field_val', 'func_display_user_fields');
And I've added the fields and conditional shortcode with the following archive.
=> hidden link
You will see how I added conditional shortcode - for example:
[wpv-conditional if="( '[get_user_field_val]' eq 'Yes' )"] Item A == [types usermeta='item-a' output='raw' user_name="[wpv-user field='user_login']"][/types] [/wpv-conditional]
Thank you.But I still need assistance.
Forexample,look at this author achive page.
hidden link
This author is
hidden link
This author achive page display this.
******************************
Author: keikou_test
User Name === keikou_test
Display-item-a value ===:
Item A ==
field val ===
******************************
But,I want to display this.
******************************
Author: 102087
User Name === 102087
Display-item-a value === Yes:
Item A == Item A-Yes! this author has posting.
field val ===Item A-Yes! this author has posting.
******************************
Well - I see something strange happening with your site: hidden link
I need FTP access details for above site and I will try to create a fresh author's archive.