Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #661503

    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

    • This topic was modified 8 years, 5 months ago by yingyang.
    #662657

    bumping this one as it appears to have been forgotten

    #662746

    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

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.