• Resolved miketheteacher

    (@miketheteacher)


    Hello friends

    I am trying to add the username of the currently logged in user into the shortcode in place of XXXX.

    <?php echo do_shortcode("[listyofiles folder='/file/XXXX/']");?>

    The do_shortcode works perfectly with the relative path, but I am struggling with adding a username.

    Is this even possible?

Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter miketheteacher

    (@miketheteacher)

    Success!

    <?php echo do_shortcode("[listyofiles folder='/file/{$current_username}']");?>

    Evan Herman

    (@eherman24)

    bah, I may have just left too many ‘s in there:

    <?php echo do_shortcode('[listyofiles folder="/file/'.$current_username.'/]"); ?>

    I also just reversed the ” and ‘. It’s hard debugging when I can’t run the code myself lol

    Thread Starter miketheteacher

    (@miketheteacher)

    <chestbump> Sweet, thanks very much for your help, bro!</chestbump>

    Evan Herman

    (@eherman24)

    Beautiful. Glad you were able to get this all worked out!

    Have a great afternoon!

    Evan

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘Do shortcode and usernames’ is closed to new replies.