When i click on twitter share icon on my post, the post title gets added and a + https://wp.me link instead of my site
I’d like this button to instead add the LARGE twitter card as explained here https://dev.twitter.com/cards/types/summary-large-image
How can i achieve that? i am a beginner
bumping this one as it appears to have been forgotten
Hi,
Thank you for using Enfold. And we are very sorry for the delay.
Please add this in the functions.php file to replace the shortlink with the actual page ur:
add_filter('avia_social_share_link_replace_values', 'avia_social_share_link_replace_values_mod');
function avia_social_share_link_replace_values_mod($replace) {
$replace['shortlink'] = get_permalink();
return $replace;
}
Unfortunately, you cannot apply the “twitter card” in the theme’s sharing patterns. You can only attach the featured image url:
add_filter('avia_social_share_link_arguments', 'avia_add_social_share_link_arguments', 10, 1);
function avia_add_social_share_link_arguments($args)
{
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'masonry' );
$args['twitter']['pattern'] = 'https://twitter.com/share?text=[title] '.$thumb[0].'&url=[shortlink]';
return $args;
}
Best regards,
Ismael