how to echo the userid in a doshortcode
-
Hey guys, I’m trying to generate a shortcode but with a variable.
<?php echo do_shortcode( '[sabai-directory-listings return="1" user_name="' . $admin . '"]' ); ?>
This returns all posts made by admin where username is admin…
I want to replace that with “where username = the user profile”
This shortcode is placed within the view profile php file in my theme…
So you go to https://www.website.com/profile/user1
And this short code will display
<?php echo do_shortcode( '[sabai-directory-listings return="1" user_name="' . $user1 . '"]' ); ?>
I am really stuck with this and could do with some help!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘how to echo the userid in a doshortcode’ is closed to new replies.