View Full Version : Data Identifier Not Working: Have Same Like Button and Like numbe On Post and Preview

03-15-2015, 09:41 PM
Hello. First of all. I am currently using the Trial version and have 3 more days and I really like it for what I'm using it for on Wordpress.

I have put a like button with the data-identifier="post_<?php the_ID()?>" into excerpts of posts that show on the Homepage. Everything is working as intended. Each post is recognized as its own post and tracks likes accordingly.

But now I was extending it and tried to put the same like button with the same code and identifier, to show likes and continue to track them on the FULL post.

But for some reason it's not working that way. It counts as a new like button and the weirdest thing is that if you like one Full post then it's the same like on ALL original posts...


I want to have a like button that is the same at two places.. The Post excerpt and the FULL post. 1 button on 2 places. Doesn't matter where you like. It counts...

Hope you understand! Can you please help me? I don't know what to do... I tried my best.

I really hopes this works cause then I will 100% Buy a new plan!!

PS. Question for plans...What does it mean for each plan the number of like buttons you can have???

03-16-2015, 10:56 AM

Your data-identifier for full post
is "post_<?php the_ID()?>" in http://oldsoul.tv/10-hairstyles-for-men-modern-look/,
must be "post_196" in http://oldsoul.tv/ for example.
Php code not working in your full-post template.
How do you pasted <?php the_ID(); ?> ?
Show please code of post template with <?php the_ID(); ?> row.

Each plan have a certain number of buttons, which you can place on site:

03-16-2015, 08:42 PM
Hey thanks for your reply.

I want this to work with 1 code so I just put it into the template in those 2 places and it works dynamically. :D

$likebtn = <<<XYZ
<!-- LikeBtn.com BEGIN -->
<span class="likebtn-wrapper likebtn-wrapperhome likebtn-wrapperpost cb-byline-element" data-identifier="post_<?php the_ID()?>" data-theme="heartcross" data-show_like_label="false" data-counter_type="subtract_dislikes" data-popup_enabled="false" data-popup_position="bottom" data-lazy_load="true" data-loader_show="true" data-site_id="5500c1dd3866e1f14d75b24a"></span>
<script>(function(d,e,s){if(d.getElementById("likebtn_wjs"))return;a=d.createElement(e);m=d.getElementsByTag Name(e)[0];a.async=1;a.id="likebtn_wjs";a.src=s;m.parentNode.insertBefore(a, m)})(document,"script","//w.likebtn.com/js/w/widget.js");</script>
<!-- LikeBtn.com END -->

This is how I define a variable, put the code in it and then output it in the template. But I had to remove it cause it was bugging my theme.

Maybe I see now that it doesn't work because <<<XYZ stops all php from working(so I can output HTML) so data identifier <?php the_ID()?> doesn't work in full template...
any other way?

03-17-2015, 09:57 AM
Do you have already installed Likebtn plugin on WordPress?
Try to use plugin shortcode, for resolve this issue:

03-17-2015, 02:11 PM
huhuh it works, thank you.

so I still don't understand the "number" of like buttons for each plan

If I have 10 posts in one page and each has its own unique like button, but uses the same code... it's 10 like buttons or 1?

03-17-2015, 03:37 PM
Good. It's 10 like buttons. They considered as unique due identifiers on page.