I'm a relative PHP newbie, so this is probably easy (but driving me nuts...)
I've installed the WP User Manager plugin, to get extra fields for users. I've added an 'address' field, and I want to display the contents of 'address' on every post (next to the author's name.)
I'm able to get it to work if I hard-code the user ID, just to test it. For example, if I include this code in my single post template:
$meta_key = ‘wpum_’.'address’; $meta_data = get_usermeta(4,$meta_key); echo $meta_data;
I get the address diplayed for user ID 4. (Ex: 123 Mockingbird Lane) Obviously, though I don't want to hard code a user ID, I want the user ID of the post author.
I've tried everything I can think of to use the_author_ID() instead of the hard coded ID, but no matter what I try, all that's output is the actual ID (in this case "4"), instead of the address.
$meta_data = get_usermeta(the_author_ID(),$meta_key); (with quotes around the_author_ID(), without quotes, with and without semi-colons, etc.)
I’ve also tried assigning the_author_ID() to a variable first.
$meta_id = the_author_ID();
I’ve tried using intval. For the life of me I can’t figure out how to get the get_usermeta function to work with the_author_ID() instead of a hard-coded number. Everything I try only outputs the number 4.
Any idea? Thanks…