How to Get User Profile Info on a Category Page

I’d like to pull in profile info (name, web address, etc. + some custom-made fields) for specific users onto some of my category pages.

I realize I can pull in profile info using “current author,” but this won’t help in this case because the user won’t be associated with the category page as an author.

Read More

For example, I’d like to be able to do the following.

On the Category A page I’d like to put User-John’s profile information (but User-John isn’t an author for any of the posts in Category A).

On the Category B page I’d like to put User-Bob’s profile information (but User-Bob isn’t an author for any of the posts in Category B).

But I will need to do this for hundreds or thousands, so I need a at least a somewhat automated way. I thought of using the Category Description box, but it doesn’t seem to accept PHP (I’ve gotten it to accept HTML and even shortcodes).

Any ideas? … Thanks in advance.

Related posts

Leave a Reply

2 comments

  1. You can get logged in user’s profile using this global variable :

    global $current_user;
    

    You need to write code into category templates(category.php & archive.php)