How to add facebook like button after read more
I'd like to add a facebook like button at the end of my excerpt, right after the read more text.
I would like to have it there, so it doesn't go below the post image, which is what happens if I put it in the footer. I'm using the iframe code, since I want to limit the number of plugins. I tried to paste the iframe code at the end of the custom read more code, but I get a strange behavior. Where should I put this code? |
why are you using an iframe?
What is the code? try wrapping the code in a div like HTML Code:
[...]<div class="facebook-thing"> hello </div> |
Quote:
Code:
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:25px;"></iframe> If I used your suggestion I should create a custom style for the facebook like button, right? |
Did you try it?
|
1 Attachment(s)
I already tried to enclose the iframe in a div and I got the same result as when not enclosing.
I only wanted to know that the style attribute would have changed. I added it but nothing changed. Attached you will find a screen capture of what I'm getting. As you can see the code isn't working. The post is not liked by 4665 people. |
It looks like an issue with the iframe code. Why not use a plugin?
|
I'm trying to limit the number of installed plugins. Moreover, many plugins don't offer enough customization options. Also, if I use the code it is saved in Atahualpa options and it could be easily recovered.
|
All times are GMT -6. The time now is 04:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.