Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

rocke on "Custom Facebook share button with custom title,url,image in wordpress"

$
0
0

I know there may be many such question in stackoverflow . but i am not getting solution what i want

i am using wordpress. In my all post page there is share button ( **via addthis plugin** ) but what happening is when i click to share on Facebook ( **via addthis plugin** ) its taking all thing perfect i means url,title but images is taken something else.


[demo url]

So i tried to made custom share button which is below the addthis plugin :

Thats : **Custom Share on Facebook page!** but when i click on it nothing happens also my title and link is shown on website : below is code of my custom facebook share :

<?php
        $title = the_title();
        $url= the_permalink();
        $summary=urlencode('Custom message that summarizes what your tab is about,  or just a simple message to tell people to check out your tab.');
        $image= wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ),  'single-post-thumbnail' );
      ?>
        <a>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>&&p[images][0]=<?php echo $image[0];?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');" target="_parent" href="javascript: void(0)">
        	Custom Share on Facebook page!
        </a>

I have also putted OpenGrap tag in my wordpress header.php between head line

<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<meta property="og:title" content="<?php the_title(); ?>" />
<meta property="og:description" content="" />
<meta property="og:image" content="<?php echo $image[0]; ?>" />
<meta property="og:video" content="" />
<meta property="og:video:width" content="560" />
<meta property="og:video:height" content="340" />
<meta property="og:video:type" content="application/x-shockwave-flash" />

please let me know what going wrong and where. i need all my post from my website should be share on Facebook and twitter with it title,images( thats **resp post** image not any other image from website which is happening now ) and its description )

Reference Link :how i want


Viewing all articles
Browse latest Browse all 8245

Trending Articles