Forums

How to Return Author ID? (3 posts)

  1. barrybell
    Member
    Posted 6 years ago #

    Hi, I need to return the author_ID into the php code, not echo it. Is there a simple way to do this, as I can only get an echo with the *php the_author_ID();* tag.

    Thanks

  2. Try get_author_ID. There's get_ versions of most of the functions.

    If that's not a valid function, just do $post->author_ID or whatever the column name is.

  3. rrho
    Member
    Posted 6 years ago #

    this should work:

    $author_id = $post->post_author;

Topic Closed

This topic has been closed to new replies.

About this Topic