Home › Forums › WTI Like Post PRO › Post Likes of User
- This topic has 4 replies, 2 voices, and was last updated 8 years, 10 months ago by desert333.
-
AuthorPosts
-
February 3, 2016 at 9:20 pm #402desert333Participant
In your pro version in WIDGET section this function to show only Likes of User is working good.
When I want to use your template file to show like within my own custom profile page is not working at all.
content-likes.php (template)
I added
<?php get_template_part( 'content', 'likes' ); ?>
inside my custom profile page to show all likes of that user and what I got is:
Favorite Posts
Nothing FoundI checked content-likes.php and I guess he can’t locate that user to get post likes…
I was trying to get code from WIDGET file here all is working fine but there is too much code… which to take
How to fix it ?
Thanks for help!
February 4, 2016 at 7:51 am #405desert333Participant1. Can you help me get this code to show post likes of logged user (from widget) ?
So I can use on inside page (not sidebar)2. Also I need to make work post likes of user page (to show all post likes for each user on their profile page) content-likes.php gives error nothing found… there is any variable I have to change/fix ?
Thanks for help!
February 8, 2016 at 6:47 pm #408WebtechideasKeymasterWe checked the code and it’s working correctly. Please make sure that the user you are trying to check has already liked some posts on your site while logged in.
You can also echo the query in the content-likes file and run that on phpmyadmin to see the results. We are sure it will pick up the user id but there won’t be anything for him in the wti_like_posts table for which it’s not showing any result. In case it does not pick the user id, you can simply hard code with any user id and see it’s now loading anything or not. If there is any error in the query, you can also see that.
Thanks
February 9, 2016 at 1:18 am #411desert333ParticipantThank you for reply.
Quick question – template “content-likes.php” is designed to shows likes of LOGGED In user only (means this user can see ONLY his likes when is logged in) ? Or to show likes of ANY User I want by going to his user page (means anybody can see likes of that user doesnt have to be logged in) ?=========================================================
Regarding your reply.
Yes database is fine , there are stored likes of user I am requesting (anyway Your Widget is working perfectly on that)The bug is in the content-likes.php template file. I double checked that and it doesnt find any user name.
I tried with :
<?php echo $author; ?>
It replies with nothing, means it doesnt catch user…The problem is with :
$author = get_user_by('slug', get_query_var('author_name'));
I forced to show likes to only specific user and it worked fine.
maybe there is a way to get user id from link ? each user has a link like http://www.domain.com/user/XXXX
– So we can feed that data XXXX then its done.Thanks
February 10, 2016 at 7:37 pm #412desert333ParticipantALL SOLVED.
-
AuthorPosts
- The forum ‘WTI Like Post PRO’ is closed to new topics and replies.