[ Resolved ] Check if showing profile page of user – UserPro Forums https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/feed/ Mon, 06 May 2024 17:13:59 +0000 https://bbpress.org/?v=2.6.2 en-US https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16729 <![CDATA[[ Resolved ] Check if showing profile page of user]]> https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16729 Thu, 09 Jan 2014 12:53:59 +0000 sanderjansma How can I check (via template functions) if a page is a profile page of a user? I want to manually include the ‘posts by user’ function in a template, but currently on the login page (same template as profile page) it shows all posts (not specifically by a user).

]]>
https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16753 <![CDATA[Reply To: [ Resolved ] Check if showing profile page of user]]> https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16753 Thu, 09 Jan 2014 22:47:09 +0000 admin The user needs to be author ofcourse. and you can get the AUTHOR id via get_the_author_meta(‘ID’) in your php 🙂

Test it, and if it returns user ID , then it is fine to use.

]]>
https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16947 <![CDATA[Reply To: [ Resolved ] Check if showing profile page of user]]> https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16947 Sun, 12 Jan 2014 14:24:21 +0000 sanderjansma Hello! Thanks for your reply! However, when I try to use get_the_author_meta(‘ID’) it retrieves the ID of the logged-in user (that’s me!).

The thing that’s going wrong is this: I have a page ‘profile’ at /profile/. This shows the login screen when not logged-in, and my profile when I am logged-in. Also, it shows a members profile when I go to /profile/membername/. However, when I add the shortcode for ‘postsbyuser’ and go to /profile/ (therefor the login page) it shows all posts, even though it doesn’t show a user.

How can I only see the ‘postsbyuser’ on a page that shows a user?

]]>
https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16949 <![CDATA[Reply To: [ Resolved ] Check if showing profile page of user]]> https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16949 Sun, 12 Jan 2014 14:45:15 +0000 keyhanjun Hi sanderjansma,

please try this code here:

<?php echo do_shortcode('[userpro template=postsbyuser user=author postsbyuser_num=4]'); ?>

Best regards,
keyhanjun

]]>
https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16950 <![CDATA[Reply To: [ Resolved ] Check if showing profile page of user]]> https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16950 Sun, 12 Jan 2014 14:50:56 +0000 sanderjansma Thanks!

]]>
https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16951 <![CDATA[Reply To: [ Resolved ] Check if showing profile page of user]]> https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16951 Sun, 12 Jan 2014 14:55:12 +0000 keyhanjun You are welcome! 😉

Btw please verify your purchase:

http://userproplugin.com/userpro/forums/topic/support-requires-verification-of-purchase-before-we-can-help/

Thanks!

Best regards,
keyhanjun

]]>
https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16989 <![CDATA[Reply To: [ Resolved ] Check if showing profile page of user]]> https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-16989 Sun, 12 Jan 2014 20:37:47 +0000 admin Thanks for your help and congrats for the new badge! 😀

]]>
https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-17010 <![CDATA[Reply To: [ Resolved ] Check if showing profile page of user]]> https://forum.userproplugin.com/forums/topic/check-if-showing-profile-page-of-user/#post-17010 Sun, 12 Jan 2014 21:50:56 +0000 keyhanjun Thanks! 😉

]]>