Hi @carloscruz02 ,
Thank you for using our plugin.
Could you explain in details what you are trying to achieve and what is the exact obstacle? So, we can understand and provide the proper workaround.
Well, basically I’m trying to show the default field ‘job_title’ in the frontend. This is my code:
get_the_author_meta( ‘job_title’, $author_id );
In the backoffice I have all the fields with values, such as biography, avatar, etc, but the only field that is not displayed is the ‘job_title’, the only field that is not a wp users standard
Hi @carloscruz02 ,
I see. Could you explain it more detailed regarding how you manage the code and apply it on the front-end? Are you creating a specific page using code and taking reference from PublishPress Authors?
Since you previously provided very small display of the screenshot, could you take wider screenshot of the display? So, we can understand what you are trying to achieve.
Thanks,
Sorry, let me be more specific now.
I’m displaying the author information on my single opinion (CPT). In the back office, I have all the author’s details registered, including the job_title. On the frontend, I can display all the fields such as Fname, Lname, Biographical, Avatar, but the Job Title always comes up empty. I’ve already tried changing the Job Title field from job_title to description, but no matter what I do, the field always comes up empty.
Image 1: Back office with the author’s registered fields.
https://files.fm/f/shpnn7qg58
Image 2: Frontend showing how it should look with job_title being displayed.
https://files.fm/f/xf4ha73qs9
Image 3: Frontend showing how it currently looks without job_title.
https://files.fm/f/h7whgsxgku
Image 4: My code for fetching the fields, including three different ways of calling job_title, and all of them return empty.
https://files.fm/f/spvvxbj2nj
https://files.fm/f/rqef5sgbsd
Hi @carloscruz02, Apologies for the delay in getting back to you.
You cannot use the get_the_author_meta to get fields that are not included as valid fields in the function documentation https://developer.wordpress.org/reference/functions/get_the_author_meta/#description since this fetch data directly associated to WP User data and this exclude custom fields data.
Please check this gist for sample way to get author user data including custom fields data https://gist.github.com/ojopaul/be610d51d74ccb0557976c1a68f507eb
Kindly let me know if you need further help.
Regards.