Skip to:
Content
Pages
Categories
Search
Top
Bottom

(Solved) PHP Link – Using Username in link


  • Veneration_
    Member

    @veneration_

    So I create a custom page for each user in a specific role.
    These pages are setup to have the url of “domain.com/client/[username]”
    So I basically need the code to be something like <a href="client/””>My Account.
    And I’m stumped. I can’t seem to figure out how to pull the usersname. I’m not much of a php guy when it comes to things like this I guess. =P

    If anyone can help, let me know.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

  • Veneration_
    Member

    @veneration_

    Just to give a better idea about what I’m trying to do.

    I’ve created pages all ending with a particular username.
    I need each user that corresponds with that page to click a link and have it send them to that page.
    So it takes their username and places it at the end of the particular link.
    Example:
    http://www.mydomain.com/client/user1234

    So the link would need to be something like a href=”www.mydomain.com/client/PHP-CODE-HERE “></a

    Hopefully that makes it a bit clearer.
    Thanks a ton!!!

    Veneration_


    Veneration_
    Member

    @veneration_

    Solved my issue!
    $current_user_info = wp_get_current_user(); echo $current_user_info->user_login;

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘(Solved) PHP Link – Using Username in link’ is closed to new replies.
Skip to toolbar