MattT
MattT

Reputation: 857

Wordpress Custom Meta Post Photo Upload

How can I create a custom meta for WordPress where the user uploads an image, one per author of course.

Upvotes: 0

Views: 377

Answers (1)

MattT
MattT

Reputation: 857

For those who want to do this, I managed to do it by creating a custom from to upload a photo, in that form I enabled the rename of the photo uploaded so it doesn't get added as a new one, then I called the wordpress blog header to capture the user ID and rename the photo to my preference-$current_user->user_login.jpg and then sorted! :) echo that.

However, on the author profile there is a twist, you can't get $current_user->user_login else you will be displaying your own photo on someone else's profile, to solve this I called and that pulls the unique images! :)

VOila! there you have it.. and this can be re-used for anything...

Upvotes: 0

Related Questions