Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Firstname and Surname on certificate
Tagged: certificate, name, shortcorde
- This topic has 12 replies, 5 voices, and was last updated 6 years, 6 months ago by Diana.
Viewing 13 posts - 1 through 13 (of 13 total)
-
AuthorPosts
-
December 11, 2017 at 12:49 pm #139540dantwahSpectatorHi! I want to show the first and last name of a user on its certificate (instead of the displayname that the default shortcode does). I saw several post on wplms but they are no longer up to date or to do not provide the correct answer. You refer to this tip: https://wplms.io/support/knowledge-base/shortcode-to-capture-a-custom-profile-field-in-student-profile/ but the video there is gone. How can I create a shortcode to do it? Love to hear from you. Kind regardsDecember 12, 2017 at 10:47 am #139637H.K. LatiyanParticipantHi, The shortcode for this is "certificate_student_field" You have to provide the field id to make it work, for example the firstname field id is 3 then the shortcode will be: [certificate_student_field field=3]December 12, 2017 at 11:17 am #139643dantwahSpectatorHi, thanks for the response. So I have tried this but with no luck. I looked up the ID of the fields in the backend, First name = first_name and Last name = last_name. Note that these are buddypress fields though. Tried the following shortcode (with and without quotes): [certificate_student_field field=first_name][certificate_student_field field=last_name] Does not work. I also tried a custom php function: add_shortcode( 'get_user_fullname', 'get_user_fullname' ); function get_user_fullname(){ global $current_user; get_currentuserinfo(); return $current_user->first_name . ' ' . $current_user->last_name; } However this code always returns my own name, not the one that it should be.. hope you can helpDecember 12, 2017 at 11:55 am #139654H.K. LatiyanParticipantHi, This is not the id, the id is numeric, refer: http://prntscr.com/hmfb6qDecember 12, 2017 at 12:02 pm #139657dantwahSpectatorHi, Thanks, though I do not need these fields, I need the buddypress fields. the name field in the student account often fetches the username instead of real name. refer: https://prntscr.com/hmfeudDecember 13, 2017 at 6:57 am #139747H.K. LatiyanParticipantHi, The fields that I showed in my screenshot are the buddypress fields only. You are sharing the wordpress user field screenshot. For this, there is no shortcode available in wplms. Since this is a wordpress field so you might find some third party plugin for a shortcode to fetch these fields.April 25, 2018 at 5:08 am #154159RMASpectatorHere is a plugin that did the trick for me. <span style="caret-color: #000000; color: #000000; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; font-size: 14px; font-weight: 600; white-space: nowrap; background-color: #f7fcfe;">Shortcodes Ultimate</span>April 25, 2018 at 5:09 am #154160RMASpectatorShortcodes UltimateApril 25, 2018 at 10:29 am #154209DianaParticipant@RMA, Thanks for updating us and our users too.May 16, 2018 at 3:31 pm #157017milla202012ParticipantDear RMA, could you please give a bit more info on how did you insert a surname in certificate? Did you use a free or payed version of Shortcodes Ultimate? Did you use a shortcode creator? What code did you insert finally? Thank you.May 17, 2018 at 5:15 am #157088DianaParticipant@milla202012, @RMA Please help @milla202012 Paste this code in wp-admin > Plugins > Editor > Select WPLMS Customizer Plugin > and paste this code in wplms-customizer.php add_shortcode( 'get_user_fullname', 'get_user_fullname' ); function get_user_fullname(){ global $current_user; get_currentuserinfo(); return $current_user->first_name . ' ' . $current_user->last_name; } Shortcode will be : [get_user_fullname]May 17, 2018 at 12:33 pm #157189milla202012ParticipantWell, here is a small problem. When I'm logged in like an admin and assign manually certificate to any student from Frontend Admin of Course I get the name of the current user - admin name, not the name of the user. Thank you!May 18, 2018 at 4:14 am #157286DianaParticipant@milla202012, This topic is someone else topic. Please post your issue here: https://wplms.io/support/forums/topic/how-to-insert-the-last-name-in-certificate/#post-157285
-
AuthorPosts
Viewing 13 posts - 1 through 13 (of 13 total)
- The topic ‘Firstname and Surname on certificate’ is closed to new replies.