WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] the_author_meta (3 posts)

  1. jcviblog
    Member
    Posted 4 years ago #

    Hello all,

    I am trying to get the author meta information to update the author page. By default, the author pages display:

    Author Archive for username

    I am using the k2 theme and the code to control this is in wp-content/themes/k2/app/display/theloop.php:
    $page_head = sprintf( __('Author Archive for %s','k2_domain'), get_author_name( get_query_var('author') ) );

    Now, I would like to add the URL information to this line so I make the following change:

    $page_head = sprintf( __('Author Archive for %s %s','k2_domain'), get_author_name( get_query_var('author') ), get_the_author_meta('user_url') );

    However, this does not display the URL and the function simply returns an empty string. I have set the URL for that user. I have tried different parameters for get_the_author_meta but they all return an empty string. I found the information about this function here.

    How can I get the url to show up?

  2. MichaelH
    Member
    Posted 4 years ago #

    Seems, changing this:

    get_the_author_meta('user_url')

    to this would work:

    get_the_author_meta('user_url',get_query_var('author') )
  3. jcviblog
    Member
    Posted 4 years ago #

    That worked. Many thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic