All custom fields are stored as user meta, so you can retrieve the value with get_user_meta().
Also, you could use the field shortcode [wpmem_field name_of_field]
I added the following code to the content-post-meta.php file:
<?php get_user_meta(); ?>
I get nothing back. Also tried:
<?php echo get_user_meta(); ?>
Still nothing. I know I gotta be doing something wrong, but I can’t figure it out. I tried the example code and DID get the user’s last name. But the custom field that I created, called title, I cannot seem to access.
-
This reply was modified 9 years, 7 months ago by
njfrese.
Ok, I finally did figure out where I was going wrong. Now, how to I get the User ID of the author so I can grab his specific title? I got it to work by hard-coding the user ID.
That’s more of a WordPress question than a plugin question; but… there are a lot of different ways (and it depends somewhat on if you are in the Loop or not). Probably the most straightforward in the Loop would be:
$author_id = $post->post_author;