Support » Fixing WordPress » How do I insert a username into a URL

Viewing 3 replies - 1 through 3 (of 3 total)
  • Going to need way more details to even help on this one.

    Where is this link being generated a plugin? Can you paste the php code that outputs it?

    Also do you have the id stored in a variable already? Or is their username the id number?

    This a WordPress site only for logged in users that will manually be given their usernames to match their affiliate IDs in the affiliate program they belong to – I have the links to post on the marketing pages which are coded to credit their accounts with commissions – however I would like each user after logging in to see these links with their username (which will be in the format 1489820) instead of the XXXXX in the links posted on the marketing pages. In other words the links will be ready for them to copy and use, instead of them having to replace the XXXXX with their affiliate ID numbers manually.

    <?php global $current_user; ?>
    <?php get_currentuserinfo(); ?>
    <?php echo '' . $current_user->user_login . "&u="; ?>

    Would output what you need. Where you are going to put it though I don’t know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I insert a username into a URL’ is closed to new replies.