Support » Plugins and Hacks » [Resolved] Get Author Profile – Dynamically calling auth_ID

[Resolved] Get Author Profile – Dynamically calling auth_ID

  • I’ve found the Get Author Profile plugin, which is great, except for one thing. I can’t figure out how to pass the author id automatically based on the post’s author…

    I have several authors on a blog, and want to display a mini profile in the sidebar, when the post is viewed on single.php. I can call the plugin’s code conditionally with is_single.

    I can pass the author ID to a variable within the loop. But I can’t seem to use that variable in the plugin’s function.

    Any ideas, anyone? I really can’t afford to hard code the author id in the function. I don’t want to create an author.php page. I feel a tad stuck.


Viewing 7 replies - 1 through 7 (of 7 total)
  • Does your sidebar come before or after the Loop on your site?

    If it comes after, then just save the author’s ID to a variable inside the Loop and global it. Then do into your sidebar, global it there too and then call it. 🙂

    Thanks Viper,

    Yes, the sidebar comes after the loop.

    I’m not sure how you “global” a variable. And (showing my ignorance here), if REGISTER_GLOBAL is turned off at server level, will that impact “globaling the variable”?

    In your Loop:

    global $theauthorID;
    $theauthorID = get_the_author_ID();

    In your sidebar:

    global $theauthorID;

    I think that will work. 🙂

    If not, you could probably have a 2nd Loop in your sidebar that doesn’t output anything. Just have it grab the ID and then end.

    Viper, you be da (wo)man. Thanks mate 🙂

    Man and you’re welcome. 🙂

    Cool. ta.

    Any way to insert the requisite code into “The Loop” of multiple themes without having to edit each theme manually?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Get Author Profile – Dynamically calling auth_ID’ is closed to new replies.