Jump to content
Sign in to follow this  
andreamarucci

Add the facebook button I like

Recommended Posts

andreamarucci

I would like to add the "I like" button from Facebook to the bottom of each one of my posts. It's only a matter to add an iframe like this one

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>&layout=standard&show-faces=true&width=530&height=60&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:530px; height:60px"></iframe>

I would like to know where to put in the code editor of the templates.

Share this post


Link to post
Share on other sites
andreamarucci

Sorry, I try to be more specific. I've found some plugins that let me do that but I would like to put the Like button on the right side to the date and category of the post if this is possible and not under the post. Thanks

Share this post


Link to post
Share on other sites
cmunns

In the _posts.php file you can add it inside of the div class called "metabar" (just inside the closing tag) Let me know if this helps.

Share this post


Link to post
Share on other sites
andreamarucci

It works thanks but there are two glitches. 1 - I would like to align the button on the righ site. Probably I could do that with css but I really don't know how to do it. 2 - I'm not able to correctly align the button since it seems that there's some more white margin around it. I think that also this one could be corrected with css but I need some expert advice...

Share this post


Link to post
Share on other sites
cmunns

No problem, just provide a link to the site. It's impossible to help at this point unless I can see what you're seeing and know what to change in the css.

Share this post


Link to post
Share on other sites
andreamarucci

ok, the site is http://blog.shift.it . Now the like button is under each post using a plugin but I would like it at the top in the metabar div. I've tried with this code

<div class="metabar">
										
										<?php _e('',TDOMAIN);?> <?php the_time(get_option('date_format')); ?> |
										<?php _e('',TDOMAIN);?> <?php the_category(', ') ?>
										<!-- <?php _e('by',TDOMAIN);?> <?php the_author(); ?>
										<?php edit_post_link(__('(Edit Post)', TDOMAIN), ' ', ' ');?> -->
	
	? <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.shift.it&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:20px"></iframe>
									</div>[/code]

but the result is this one 6b3879015a891be066288d75a4b9f14e.png As you can see the button is misaligned and I would like tu put it on the right side, not just after the categories. Now I've disabled it. If you have some try for me let mne know and I'll do that... Many thanks for your help...

Share this post


Link to post
Share on other sites
cmunns

It's actually a little complicated getting it to display correctly on the right side, but you could display quite nicely just underneath the meta bar. I found that very simple as I tested solutions.

Share this post


Link to post
Share on other sites
andreamarucci

Thanks Adamas. Putting it underneath is simple. I've tried with success but I think it's better on the right but if it's too difficult doesn't matter. What about aligning correctly the button in the grey bar instead?

Share this post


Link to post
Share on other sites
cmunns

I thought that's what you were trying to do before?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×