AddThis code on the front page of the site?
AnonymousJanuary 20, 2012 at 9:26 pm #2905
Hi, I’d like to have my AddThis button code show up on the front page of my site, not just once someone drills down into a particular post. I searched the forums and found this (now-closed) thread on the same subject:
I updated the theme and noted the verbiage about the([#post-url] and [#post-title])tags on the options screen, but I’m not sure exactly how to implement this.
Any idea how I can get the buttons to display on the front page?
Thanks so much for the quick reply, Josh. I thought text widgets were just for the sidebar and I’m not familiar with action hooks, but I’ll look into both this weekend.
I’d just want the buttons displayed in exactly the same place that Graphene currently displays them once posts are drilled into: either the top or bottom of the post content.
Action hook tutorial is here:
I think you’ll find that easy to do, although it might take a couple of tries to get it right.
Please note, however, that social sharing buttons inevitably link to the page they appear on. So if all your posts or excerpts on your front page show social sharing buttons, clinking on them will create a link to your front page, not to the post they originate from.
You’ll need to use the AddThis API to explicitly define the URL, Title, and Description of the page the buttons are sharing, regardless of on which page the button is placed: http://www.addthis.com/help/url-and-titleMod
I really have no idea. I use AddThis code out of the box. I don’t use social sharing buttons on my front page or excerpt pages for two reasons:
1. That is really valuable real estate and I want to fill it with my content.
2. I want people to actually read what I write and think about it before they share it.
But if you figure it out, feel free to share it. A lot of other people would like to know how, I bet.
(Love you site, btw.)
Thanks, Kenneth – I’m starting to wonder if this is too time-intensive for me to get into, but if I decide to tackle it and actually manage to get it to work, I’ll for sure do a post about it. I think this is something that probably affects people who post visual art more than people who post writing; if you post writing, the reader *has to* drill into the post in order to read the whole article, but with a site like mine, people can just browse the front page of the site and really don’t need to drill into anything.
I’m a bit surprised this is so involved. Clearly WP “knows” the URL and title of each post as it populates the front page. I’d think it’d be easy to therefore pull the post title and URL and use those to actively generate the AddThis code for each entry on the homepage.
Anyway, thanks for the help (and the kind words about my site). I’ll pop back in if I dig into this and get it to work.
You must be logged in to reply to this topic.