I'm doing:
$fb = "http://www.facebook.com/sharer.php?t=".$title."&u=".$url;
That line is inside a while loop getting results from database. $url is always the same one but $title changes depending on the row.
Now I build the links and when I click them, they always show in my Wall the
<meta name="title" content=''>
text from my main page and not the $title text.
What can I do to fix this and share the text contained in $title?
Here the code I'm trying with og. After hitting the link the share text in my Wall is "Google" instead of what is in my variables:
<?php
$tt = "Some text in the meta";
$url_p = "http://www.google.com";
$url = urlencode($url_p);
$text = "Text I want to show";
$title = urlencode($text);
$fb = "http://www.facebook.com/sharer.php?t=".$title."&u=".$url;
?>
<meta property="og:title" content="<?php echo $tt; ?>"/>
<a href="<?php echo $fb; ?>">share link</a>
Head over to Meta's documentation and use their button configurator to get the code for a Like and Share Button, or a Share Button. Once you select the options for your custom button, click the Get Code button and a new dialog box will appear with two different scripts.
You can use this one, is much better and you don´t have to use metatags:
http://www.facebook.com/sharer/sharer.php?s=100&p%5Btitle%5D=Title&p%5Bsummary%5D=Test%20Summary.&p%5Burl%5D=http://www.ideocentro.com/&p%5Bimages%5D%5B0%5D=https://static.e-junkie.com/sslpic/64332.ed95f53b41bc4885dd86e2b485f08a3b.jpg
This isn't currently possible via the sharer API if your url is 'always the same' and please include any relevant code since I cannot see how your, 'ine is inside a while loop getting results from database'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With