• 0
Sign in to follow this  
Followers 0

How to add twitter and facebook buttons next to the title.

Question

Posted · Report post

Hello. I want to add the tweet button and facebook like button next to the title, date and author information, so that when a user clicks on the home page they can see how many tweets and likes each post has gotten. I sought of understand how to use hooks now so it shouldn't be too hard, but I can't seem to get it right. Do any of you have any ideas? Here area some screenshots to illustrate what I mean: My website currently, Screen-shot-2011-05-01-at-4.48.41-PM.png A website like Mashable with the buttons, Screen-shot-2011-05-01-at-4.51.15-PM.png

Share this post


Link to post
Share on other sites

13 answers to this question

  • 0

Posted · Report post

People usually just use plugins that do this automatically.. like Wordpress Facebook Like Plugin and various tweet-this plugins and such. Did you have your own code snippets that you wanted to embed instead?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hey Tim, Thanks for your reply. The problem with the plugins is I can't figure out how to get them to display in the post excerpt right next to the Title, author and date. I'd prefer to use a hook and try it that way. Here's some twitter code that I want to add to a hook, I'm just not sure which hook to use. `Tweet`

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I use one called share post (make sure not to download the wrong one, there are few with similar names but not as good). It puts any of the social media buttons on your page or post (you can set in options). Everything is automatic you just set which ones you want to show. I just saw it earlier today on wordpress, but here's the plugin's official site: http://dev.linksku.com/sharepost/

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Tweet<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>[/code]

Sorry, this is the correct code. @ Chris. Will that display them in the excerpts on the main page?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Why does it keep doing that?

Tweet<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>[/code]

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Andrew, the hook you might want to use is pagelines_inside_top_maincontent.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Hey Catrina, Thanks for your help but that hook only displayed the tweet button for the home page rather than each individual post.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I would start with something like this: ` add_action('pagelines_loop_post_header_start','tweettweet'); function tweettweet(){?> Tweet <?php } ` Then position it accordingly by adding HTML/CSS

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks Adam, that got it showing up in each post excerpt, but it's still showing the tweet count for the website: Screen-shot-2011-05-04-at-2.21.20-PM.png

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

How can I get it to only show the tweet count for each individual post rather than the whole thing?

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Probably just need to change the function to this: ` http://twitter.com/share??? data-text=???<?php the_title(); ?>??? data-url=???<?php the_permalink() ?>??? data-count=???vertical??? data-via=???socialblogr???>Tweet `

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I tried some plugins for share-buttons (instead of platformpro sharebar) but they are not working in the template (are not displayed). What is the problem? Thanks, CK

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Christian, Would please start a new thread if you have trouble with the plugins you are using.

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  
Followers 0