Forums

edit profile on author.php if profile = logged in user (3 posts)

  1. dikkevandale
    Member
    Posted 2 years ago #

    I would like to display a button "Edit Profile" if a user that is logged in is looking to it's own author.php (user profile).

  2. westondeboer
    Member
    Posted 2 years ago #

    You might need to add a if is logged in. But I am pretty sure that is built in. This will only work on the profile page I THINK.

    <?php
    global $current_user;
    get_currentuserinfo();
    if ($current_user->ID == $curauth->ID) {
    echo "<a href='http://iknowtheledge.com/wp-admin/profile.php'>Edit Profile</a>";
    }
    ?>

    adding this to tipsforwordpress.com

  3. dikkevandale
    Member
    Posted 2 years ago #

    Thanks, I changed it a little bit :)

    <?php
    global $current_user; get_currentuserinfo();
    if ($current_user->ID == $curauth->ID) { ?>
    <a href='<?php bloginfo(url);?>/wp-admin/profile.php'>
    <img src="<?php bloginfo('template_url'); ?>/img/editbutton.jpg"></a>
    <?php } ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags