• Resolved laborer99

    (@laborer99)


    Hi

    I am trying to display a registered users external URL in the main post section of my WP blog by adding an extra field below the date and time, saying “View authors website HERE”… To do this I am trying to tap into the field in the database that contains the users website URL (the optional field that the user fills in upon registraton or is filled in by the admin when setting up the account).

    Question is what is this field called, does anyone know? I just can’t figure it out. This is what I have:

    <?php the_date(); ?> @ <?php the_time() ?> <?php edit_post_link(__(‘Edit This’)); ?></div>
    <div class=”blog_text”><?php _e(“View authors website:”); ?> <?php USER_URL(__(‘HERE’)); ?> </div>

    what should replace “USER_URL” ? i’ve tried a few things but they all break the blog (using comment_author_link just ends up with ‘Anonymous’ and no link underneath).

    and… am I even attempting it correctly with this code?

    PLEASE help
    thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Two possibilities:

    echo get_usermeta($post->post_author,'user_url');

    or

    the_author_meta( 'user_url');

    Thread Starter laborer99

    (@laborer99)

    thank you! I’ll try this out and post what happens.

    thanks again

    Thread Starter laborer99

    (@laborer99)

    Michael

    Thank you for your reply

    echo get_usermeta($post->post_author,'user_url');

    does indeed work! However how do I get the URL to firstly show up as an html ‘live’ link? secondly, what code would I use to make it sit under the word ‘HERE’.

    I have tried a few things:
    echo get_usermeta($post->post_author,'user_url', 'HERE');
    and
    echo get_usermeta($post->post_author,'user_url'(__('HERE'));
    amongst other thniks but they don’t work – little help please?

    Thank you again!

    <a href="<?php echo get_usermeta($post->post_author,'user_url'); ?>">HERE</a>

    Thread Starter laborer99

    (@laborer99)

    Thanks! It works great.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Displaying user profile’s website field?’ is closed to new replies.