php - Add Open Graph Meta Tag After Page is Loaded, for Facebook Share button -
i have assign thumbnail page:
<meta property="og:image" content="http://example.com/example.png" />
however, site wordpress site, information of thumbnail loaded when body loaded (it wordpress page). therefore, use following js add tag (inspired question):
<script> $('head').append('<meta property="og:image" content="http://example.com/example.png" />'); </script>
the tag added <head>
, thumbnail not display after click facebook share button. true facebook button evaluate original source code, instead of modified source code?
if yes, can make facebook share button's thumbnail appearing ?
fyi, here facebook share button code:
<fb:share-button type="button_count" href="http://example.com"></fb:share-button>
i don't think possible, since js code not executed. see how facebook sharer select images , other metadata when sharing url?
can update these meta tags client side code javascript or jquery? no. search engine crawlers, facebook scraper not execute scripts whatever meta tags present when page downloaded meta tags used image selection.
Comments
Post a Comment