Take the 2-minute tour ×

I am trying to setup a share button for facebook, twitter, and the other major share sites. The thing is when I use the methods I have found they only let me manually add the url to the share, not the text or title. This is an issue because on my site the share buttons would be on some posts, the main page showing 10 at a time, with a quotes page showing one and the comments. These posts are gotten from the database via a php function, returned to the index and it shows them. Then index takes care of what type to show.

The issue here is the share button looks at index.php for the title and text, both of which are dynamically added. So it find the wrong data. Is there anyway to manually tell it what text and title to use? If not then any advice on what to redesign to make it work?

Site url: http://ohmsgaming.com/nstdt/index.php

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I'm not exactly sure what you mean by "share", but if you are referring to the old share button/url then you should not use it since it's deprecated and no longer supported as it states here:

The Share button has been deprecated in favor of the Like button, and will no longer be supported. Please use the Like button whenever possible to drive maximum traffic to your apps.

(reference: http://developers.facebook.com/docs/share/)

And here:

What happened to the old Share button?


(reference: http://developers.facebook.com/docs/reference/plugins/like/)

Instead use the Like button, and just use different urls for the url of the like, something of of this sort: *http://your.domain/post.php?id=POST_ID*. The data will be extracted by facebook from your page, so you need to specify open graph tags that match the POST_ID.

Another approach is to use the fb js sdk to post to the feed, like so:

var obj = {
    method: "feed",
    link: "LINK_URL",
    picture: "PIC_URL",
    name: "Test feed dialog",
    caption: "Testing posting",
    description: "more text"

FB.ui(obj, function callback(response) {

As you can see you can control all fields.

share|improve this answer
I did mean the like button sorry about that. And what open graph tags would I need for the first approach, being this is how my site is set up. And any advice on twitter, I was going to use the ?status link for it. –  Tempus35 May 7 '12 at 9:37
Try this Built-in Object Types page. –  Nitzan Tomer May 7 '12 at 9:41
Ok I am looking at that link, and it might be I am just tired but how would I make an OG tag for each post each time they are loaded, in the head of the file. From the link it looks like only one post can be defined in the head, and in my site the head is loaded outside the index and is on every page, so I need some way to have 10 OG tags for 10 posts, and to update that often. –  Tempus35 May 7 '12 at 9:47
Facebook works with urls, you need to differentiate between posts by their urls. So one post will be "your.domain.com/post.php?id=xx" and the other will be "your.domain.com/post.php?id=yy". For each post you then generate different og tags –  Nitzan Tomer May 7 '12 at 11:03
add comment

Your Answer


