Jump to content


Photo
- - - - -

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


  • Please log in to reply
13 replies to this topic

#1 liverpoolfootballblog

liverpoolfootballblog

    Advanced Member

  • Members
  • PipPipPip
  • 49 posts

Posted 01 May 2011 - 06:54 AM

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,

Posted Image

A website like Mashable with the buttons,

Posted Image

#2 timlinson

timlinson

    Advocate

  • Members
  • PipPipPipPipPip
  • 1032 posts

Posted 01 May 2011 - 08:04 AM

People usually just use plugins that do this automatically.. like

Please Login or Register to see this Hidden Content

and various tweet-this plugins and such.

Did you have your own code snippets that you wanted to embed instead?

#3 liverpoolfootballblog

liverpoolfootballblog

    Advanced Member

  • Members
  • PipPipPip
  • 49 posts

Posted 01 May 2011 - 08:10 AM

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. `

Please Login or Register to see this Hidden Content

`

#4 hyest

hyest

    Advanced Member

  • Members
  • PipPipPip
  • 33 posts

Posted 01 May 2011 - 08:14 AM

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:

Please Login or Register to see this Hidden Content



#5 liverpoolfootballblog

liverpoolfootballblog

    Advanced Member

  • Members
  • PipPipPip
  • 49 posts

Posted 01 May 2011 - 08:20 AM

Please Login or Register to see this Hidden Content


Sorry, this is the correct code.

@ Chris. Will that display them in the excerpts on the main page?

#6 liverpoolfootballblog

liverpoolfootballblog

    Advanced Member

  • Members
  • PipPipPip
  • 49 posts

Posted 01 May 2011 - 08:25 AM

Why does it keep doing that?

Please Login or Register to see this Hidden Content



#7 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 01 May 2011 - 03:39 PM

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

#8 liverpoolfootballblog

liverpoolfootballblog

    Advanced Member

  • Members
  • PipPipPip
  • 49 posts

Posted 02 May 2011 - 06:16 AM

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

#9 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts
  • Country: Country Flag

Posted 02 May 2011 - 07:22 PM

I would start with something like this: ` add_action('pagelines_loop_post_header_start','tweettweet'); function tweettweet(){?>

Please Login or Register to see this Hidden Content


#10 liverpoolfootballblog

liverpoolfootballblog

    Advanced Member

  • Members
  • PipPipPip
  • 49 posts

Posted 04 May 2011 - 04:34 AM

Thanks Adam, that got it showing up in each post excerpt, but it's still showing the tweet count for the website:

Posted Image

#11 liverpoolfootballblog

liverpoolfootballblog

    Advanced Member

  • Members
  • PipPipPip
  • 49 posts

Posted 05 May 2011 - 12:14 PM

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

#12 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts
  • Country: Country Flag

Posted 05 May 2011 - 07:51 PM

Probably just need to change the function to this: `

Please Login or Register to see this Hidden Content

`

#13 christiankramer

christiankramer

    Member

  • Members
  • PipPip
  • 18 posts

Posted 09 June 2011 - 07:48 PM

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

#14 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts
  • Country: Country Flag

Posted 09 June 2011 - 08:41 PM

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