-
Hello.. how do I adopt this..
<?php echo do_shortcode(‘[userpro template=view]’); ?>
so that is shows the particular user being viewed instead of showing the logged in users profile?
I would like to replace the profile view on the default page provided by my theme but retain the other information on that page.. it’s a q&a theme and it shows their posts and responses and such.
Thank you
btw.. facebook login wasn’t working on this support site in chrome browser..
I “think” I figured out that it’s this?
<?php echo do_shortcode(‘[userpro template=view user=”author”]’); ?>
the only problem for me is that userpro translates spaces in usernames to periods (.) and my theme translates spaces in usernames to hyphens (-). How can I fix this?
actually.. this doesn’t appear to be working either.. hmm… could use some help 🙂
you can see at my site here
http://www.jailbreakhq.com/
http://www.jailbreakhq.com/author/admin/it works for the username admin.. but that’s the only one 🙁
The others I guess all have spaces/hyphens/periods etc
you can see here what happens to the other profileshttp://www.jailbreakhq.com/author/peter-armenti-7/
any help would be MUCH appreciated
Hi parmenti,
UserPro do not allow dashes in usernames, a space will work fine. but a dash in username is not designed to work. If you want a work around, edit your api.php find: $arg = str_replace(‘-‘,’ ‘, $arg); and remove this line this will remove the dash rule and usernames with dashes will work fine.
I just connected my facebook account via Google Chrome. I can’t reproduce this issue, and I didn’t receive a similar bug report. Will wait to see if anyone can confirm this issue. Thanks 🙂
for some reason the code
<?php echo do_shortcode(‘[userpro template=view user=”author”]’); ?>
is not pulling accurate usernames..if I replace “author” with the correct username than it works fine..
but otherwise it doesn’t seem to work at all..user”author” should be mapping directly to the username, right?
if not, what field exactly is it mapping to and what is the problem?in other words.. the username is peter.armenti.7
if I enter
<?php echo do_shortcode(‘[userpro template=view user=”peter.armenti.7″]’); ?>
it works fine on that particular profile.but it doesn’t work with user=”author”
am I missing something?I turned debugging mode on now if you want to look at these 2 url’s again..
You’ll see that the first one works.. and the second does nothttp://www.jailbreakhq.com/author/admin/
http://www.jailbreakhq.com/author/peter-armenti-7/parmenti,
[userpro template=view user=author] will work ONLY if it is embedded to a loop or inside an AUTHOR identified post, or page.
Please read my comment regarding the dash. Dashes in usernames are not allowed that’s why the second one does not work. Space is already converted to username, which makes the plugin convert your dash to space when getting the profile (See my reply for the fix)
I was mistaken when I was talking about the dashes.. the dashes are only being converted from periods in the URL. The pages that I’m placing them on are the profile pages so they “should” be author identified pages, no? If not, how can I make them so? I’m going to try a few more things but any assistance you could give me would be great. It seems that the only one that works is admin because that is the default author I think.. It doesn’t work with any other usernames regardless of punctuation so I guess it’s not identifying the author/username on these pages..
This code produces the correct username (author) on the page.. how can I work this into the shortcode.. sorry, I have VERY limited php knowledge.
<?php
echo $curauth->user_login;
?>So simply do this:
user_login.'”]’); ?>
This should take the user dynamically (author) according to your example. Any dynamic variable containing the author username should work.
Thank you so much for the response.. I’m just getting a syntax error with that.. do you see something that might be wrong with it?
http://www.jailbreakhq.com/author/peter-armenti-7/
Parse error: syntax error, unexpected ‘]’ in /home/jbreak/public_html/wp-content/themes/qanda/author.php on line 25
ok.. I got it to work with this.. there probably was some posting problems in the forum here
<?php
echo do_shortcode(‘[userpro template=view user=”‘.$curauth->user_login.'”]’);
?>I’m VERY excited.. thank you so much
The topic ‘[Resolved] View php shortcode for individual users?’ is closed to new replies.