简体   繁体   中英

How to add meta tags in search result page, for sharing to facebook with addthis

I have addthis plugin in my serach result screen. When I googled its being told that for sharing our own customized images, title, description etc, we have to use og:image, og:title etc. But here my problem is if I add the meta tags in the head tag beggining of the page, for whole search result it will be sharing the same image and title in facebook. I have to share separate image and title for each search result. Please help

You don't need to set meta tags for your search page. You need to set the URL that is being shared to Facebook to the URL of the search result and not the page of search results. So for each search result, you would need to do something like:

<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://www.supportmyidea.com/2014/03/06/sxsw-festival-using-ibeacons-interactive-sessions/' addthis:title='SXSW Festival using iBeacons for interactive sessions'>
    <a class="addthis_button_facebook"></a><a class="addthis_button_twitter"></a>
    <a class="addthis_button_email"></a><a class="addthis_button_pinterest_share"></a>
    <a class="addthis_button_compact"></a>
    <a class="addthis_counter addthis_bubble_style"></a>
</div>

If you look at this homepage ( http://www.supportmyidea.com ), you'll see how each set of share buttons is actually sharing the blog post and not the homepage. The same thing would apply to a list of search results. Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM