feature image can not share on facebook in single.php
-
Hello all,
I want to share post feature image in my facebook account.
For that I have use the facebook share button code.
It will working fine with my one template page, but as I have use this code in single.php, it could not work, I can not identify the reason.
I have use the code in my single.php file like://header <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=196109523902137&version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> //to get feature image url $url = wp_get_attachment_url( get_post_thumbnail_id($_GET['id']) ); $share_url = get_permalink(get_the_ID()); <a id="ref_fb" href="https://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $description;?>&p[url]=<?php echo urlencode($share_url);?>& p[images][0]=<?php $url;?>" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600'); return false;"> <img src="<?php bloginfo('template_url')?>/_images/fb.png" alt=""/></a>
i have share the posr succefully but can not see the feature image.
you can test/see from this url:
https://www.novelwall.org/dev/cv-builder-overview-post1/?id=956&&tabName=content-1&&page=jobs
I have also echo the url in above code but ??Any help will be apreacialble. thank you.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘feature image can not share on facebook in single.php’ is closed to new replies.