-
AuthorPosts
-
July 18, 2018 at 11:59 am #986907
Hi there,
I am using Yoast (just so you know) and I have created all my Woocommerce products using the ALB.
I have set up my Twitter Card and the image for an example product shows correctly, I have also tested the card in the Twitter validator which appears to check out ok and the site is whitelisted as there is no prompt for that and the generated log finds the metatags, but the generated preview is not a large image as intended or configured within Yoast or the Product setting.
When I test a share to Twitter using the share element button all it generates is an abbreviated url link and not a summary with a large image as it is supposed to do.
Is this a failure of Enfold, or a clash with Yoast or something else that I have not done?
Links to screenshots in pvt content.July 19, 2018 at 2:14 pm #987409Hey Craig,
Thank you for using Enfold.
Are you using the theme’s social share section? The twitter button will only use the title and the shortlink (wp_get_shortlink). It won’t be able to detect Yoast’s twitter card options. You’ll find this pattern in the includes > helper-social-media.php file.
'twitter' => array("encode"=>true, "encode_urls"=>false, "pattern" => "https://twitter.com/share?text=[title]&url=[shortlink]"),
Best regards,
IsmaelJuly 19, 2018 at 2:45 pm #987422Hi Ismael,
So anyone clicking on that button just generates that “Share a link with your Followers” thing?
But, if you then check the Twitter feed the Summary with large image is actually what gets posted.
Is that correct?
So there isnt a way of generating a preview of the tweet they are going to make before they make it basically, is that correct?Regards
CraigJuly 20, 2018 at 1:45 pm #987821Hi,
Yes, that’s what it does. I think the card is not displaying because the og:url is supposed to be the same as the shared link in the tweet. Add this filter in the functions.php file to change the twitter pattern.
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1); function avia_add_social_share_link_arguments($args) { $permalink = get_the_permalink(get_the_ID()); $args['twitter']['pattern'] = 'https://twitter.com/share?text=[title]&url=' . $permalink; return $args; }
Or maybe that’s how it’s supposed to work — twitter cards will only display on the actual feed, not when tweeting.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.