UserPro Forums
  • Create new topic
  • Forums
    • No replies topics
    • Newest topics
    • Forum statistics
  • Account
    • Lost password
    • Register
    • Login
  • Documentation
  • Back to main site

Community Forums

User To User Support Forum/Forums/Support Questions (UserPro)/Profile Card Logged in user

Profile Card Logged in user

authorauthor.phpprofileprofile card
  • 8 years, 11 months ago Avatarmediakliqco
    Participant

    Ok basically I want the correct user displayed on author.php even if user has 0 post. I want users to view other user profiles on author.php and not having to be logged in public should be able to view as well. Presently if user A views user B user A is displayed is the problem Why? because user A has 0 post. But when user A makes a post everything works probably.

    The problem with this is when a new user registers and click the profile link connected to author.php they won’t see their profile because they haven’t made a post. Not good will confuse the user and not every user will post they may just register to view and follow other users. Basically this is a major function with wordpress and userpro was built around wordpress it should work. Great plugin but without this it can be useless in a lot of projects. Thanks

    8 years, 11 months ago Avataradmin
    Keymaster

    I am currrently working on a solution for this issue.

    8 years, 11 months ago Avataralexwadja
    Participant

    Thanks for the great support. This fix will allow designers to create very flexible profile pages for authors that you visit where the sidebar and content of a profile will compliment each other nicely.

    8 years, 11 months ago Avataradmin
    Keymaster

    Can I know one thing? How do you view the author archive of user who have no posts? Cause I tried and it does not show, it gives 404 error if user has no posts (Not author yet). So how were you able to see author page who has 0 posts please?

    8 years, 11 months ago Avataralexwadja
    Participant

    Hi,

    What I did is from the userpro support docs I added the filter:

    //Change profile URL to author URL
    add_filter(‘userpro_user_profile_url’, ‘userpro_author_url’, 99, 2);
    function userpro_author_url($link, $user_id) {
    return get_author_posts_url( $user_id );
    }

    Which changed the links to go to the author archives instead of profile.

    Then I simply added the shortcode with [template=view user=author] to a sidebar and now when I click on a profile URL in userpro template view it goes to the author url.

    8 years, 11 months ago Avataradmin
    Keymaster

    But my author urls (for authors without posts show 404 page) Is that normal?

    8 years, 11 months ago Avataralexwadja
    Participant

    I think this depends on the theme. I did not get a 404 but I am running a magazine theme and the authors link goes to the authors URL /author/alex/ for example which is by default a page containing the author posts if any. With the filter you provided this author page has become my profile user home page.

    8 years, 11 months ago Avataradmin
    Keymaster

    Ok can you send me your theme just for testing purposes?

    8 years, 11 months ago Avataralexwadja
    Participant

    Yes…no problem. Should I send to you via the deluxetheme email address?

    8 years, 11 months ago Avataradmin
    Keymaster

    Yes please!

    8 years, 11 months ago Avatarmediakliqco
    Participant

    Ahmed thanks for looking into a solution and just as alexwadja said it depends on the theme. The theme I’m using has a default profile that is linked to author.php so I just replaced it with userpro shortcode and used

    //Change profile URL to author URL
    add_filter(‘userpro_user_profile_url’, ‘userpro_author_url’, 99, 2);
    function userpro_author_url($link, $user_id) {
    return get_author_posts_url( $user_id );
    }

    As well. Now I can tell you this theme uses the same auth at the top of author.php as userpro and also in the registration form the action=login_post… Which I assume that it is making some sort of default post in the system to activate author from ?author=0 to the correct ?author=1, ?author=2 and so on with the correct id to match new user.

    8 years, 11 months ago Avataradmin
    Keymaster

    Hi! I have an update, I have made changes to the code to allow the card / profile view to work on AUTHOR ARCHIVES as well as POSTS based on author being viewed even if he has NO POSTS! This fix is now available at customer portal, please get it and try to display the CARD or PROFILE on author.php Archive, keep me posted if it is solved please!

    8 years, 11 months ago Avataradmin
    Keymaster

    Download the update from here.

    I got it to work on Author template :

    [userpro template=card user=author]

    or

    [userpro template=view user=author]

    Author will be DYNAMICALLY fetched from author archive.

    8 years, 11 months ago Avataradmin
    Keymaster

    mediakliqco please try the update, in author archive. user=author and let me know!

    8 years, 11 months ago Avatarmediakliqco
    Participant

    Ahmed excellent work thank you all is working so far…. There’s just one small adjustment when you click edit profile that works! great! making changes and updates work great! but when you save then hit view profile… profile goes to a blank profile with ?author=0 if you refresh the page then the profile comes back.

Viewing 15 posts - 16 through 30 (of 49 total)
← 1 2 3 4 →

You must be logged in to reply to this topic.

Disclaimer

This forum is 100% free and USER to USER support only. Technical support staff doesn’t monitor this forum actively.

If you are a customer and want to get technical support from our staff please submit a technical support ticket here: UserPRO Technical Support

Recent Topics

  • Custom Badges AddOn Plugin here
  • Green Trust Cash APplication
  • How to use cash app without a bank account
  • Install Cash App on your Device [100%] by yourself | Step-by-Step Guide
  • Green Trust Cash Application

About forum

Here you can find help from UserPro plugin developers and other UserPro fellow users. Please be polite and ask your questions. NO SPAM!

Search Forums

Follow us

  • facebook
  • twitter
  • youtube
© Copyright UserPro