简体   繁体   中英

Associate Like Buttons/Tweet Buttons with Individual Posts

I Have Created a PHP Blog coded by myself. On the Homepage, all the recent posts are displayed.

I added the Code for Facebook Like and Tweet under the title of each post, but the Buttons work for the homepage, instead of each individual post. All the button contain same values.

The buttons work fine for each individual post when displayed as a single page with their own URL.

How can i Make the Like buttons work for individual posts from homepage.

Use the URL of the individual blog entry in the Like button code. For example if using HTML5 version of Like button then something like:

<div class="fb-like" data-href="http://www.example.com/blog/1" data-send="false" data-width="450" data-show-faces="false"></div>
<div class="fb-like" data-href="http://www.example.com/blog/2" data-send="false" data-width="450" data-show-faces="false"></div>

Or if using XFMBL version then:

<fb:like href="http://www.example.com/blog/1" send="false" width="450" show_faces="false"></fb:like>
<fb:like href="http://www.example.com/blog/2" send="false" width="450" show_faces="false"></fb:like>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM