Home › Forums › WTI Like Post PRO › How do I use the GetWtiLikePost() function
- This topic has 2 replies, 2 voices, and was last updated 7 years, 1 month ago by atomikt22.
-
AuthorPosts
-
November 17, 2017 at 12:14 pm #597atomikt22Participant
When i use the GetWtiLikePost() function in php, it echoes the like section at the top of the page, and all the like sections are nested wihtin each other. Here is my code:
if($query->have_posts()): $html .= "<div class='posts_wrapper'>"; while( $query->have_posts() ) : $query->the_post(); $html .= "<div class='post_wrapper'>"; $html .= "<a href=\"" . get_permalink() . "\">"; $html .= "<img src='" . get_the_post_thumbnail_url() . "' />"; $html .= "</a>"; $html .= "</div>"; GetWtiLikePost(); endwhile; $html .= "</div>"; endif;
And here is the source code (the start of it at least):
<div class='watch-action'> <div class='watch-position align-left'> <div class='action-like'> <a class='lbg-style1 like-114 jlk' data-task='like' data-post_id='114' data-nonce='ec6cd3a35c' rel='nofollow'> <span class='wti-text'>Yes</span> <div class='action-unlike'> <a class='unlbg-style1-active unlike-114 jlk' data-task='unlike' data-post_id='114' data-nonce='ec6cd3a35c' rel='nofollow'> <span class='wti-text'>No</span> </a> </div> </div> <div class='status-114 status align-left'>You have already voted. </div> </div> <div class='wti-clear'> </div> <div class='wti-user-likes wti-likes-114'> </div> <div class='watch-action'> <div class='watch-position align-left'> <div class='action-like'> <a class='lbg-style1-active like-85 jlk' data-task='like' data-post_id='85' data-nonce='ec6cd3a35c' rel='nofollow'> <span class='wti-text'>Yes</span> <div class='action-unlike'> <a class='unlbg-style1 unlike-85 jlk' data-task='unlike' data-post_id='85' data-nonce='ec6cd3a35c' rel='nofollow'> <span class='wti-text'>No </span> </a> </div> </div> <div class='status-85 status align-left'>You have already voted. </div> </div> <div class='wti-clear'> </div> <div class='wti-user-likes wti-likes-85'> <img src="http://localhost/member_test/website/wp-content/uploads/ultimatemember/1/profile_photo-40.png?1510920752" class="func-um_user gravatar avatar avatar-32 um-avatar um-avatar-uploaded" width="32" height="32" alt="Tom Roelants" />like this </div> <div class='watch-action'>
- This topic was modified 7 years, 1 month ago by atomikt22.
- This topic was modified 7 years, 1 month ago by Webtechideas.
November 17, 2017 at 6:38 pm #600WebtechideasKeymasterYou are creating the html content and appending content to it. But you are directly printing
GetWtiLikePost()
Try appending the function output like below$html .= GetWtiLikePost();
If the above does not work, try like this
$html .= GetWtiLikePost('put');
Do let us know if this worked or not.
November 21, 2017 at 8:41 am #603atomikt22ParticipantI reset the options and then it worked. After a bit of trial and error, i found out that setting the option “Show like/unlike counts” to “don’t show” triggers the bug i explained above.
-
AuthorPosts
- The forum ‘WTI Like Post PRO’ is closed to new topics and replies.