Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #716622

    Hi,

    if I share one of my blogposts in twitter the post image doesn’t show up. What can I do about that? Any ideas?

    Thanks,
    Ellie

    #716724

    Hey e_zips,

    You can set the image you want to display on social networks using a plugin like Yoast SEO: https://wordpress.org/plugins/wordpress-seo/. Please try that out to see if you have any luck with it.

    Best regards,
    Rikard

    #716734

    Hi Rikard,

    I’ve already used Yoast Seo and it works pretty well with facebook but not with Twitter.
    Any idea why?

    Best regards,
    Ellie

    #716846

    Hi Rikard,

    I’ve figured out the problem. There was a typo in the setup protocol. Now, that I’ve changed it the twitter tab is displayed.
    Unfortunately, the theme does not use the data from there. For this post “http://www.shortcuts.life/2016/11/24/zeit-fuer-weihnachtskarten/” I’ve included all information in the twitter-tab but it doesn’t show up when tweeting the post. Any idea?

    Best,
    Ellie

    • This reply was modified 7 years, 12 months ago by e_zips.
    #717594

    Hi!

    The image is not included in the “share pattern”. You can filter the pattern with the following code.

    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;
    }

    // https://kriesi.at/support/topic/large-twitter-card-for-post-share-icon/#post-662746

    Best regards,
    Ismael

    #717632

    Hi Ismael,

    thank you very much for your reply. I copied the code in the functions.php of my child theme but then my page didn’t work any longer. What exactly am I supposed to do with the code? Sorry for asking such a question but I’m a beginner.

    Thank you,
    Ellie

    #718101

    Hey!

    I can’t see the code anywhere in the functions.php file. Did you remove it? We want to add it again but it will break the site if the function got duplicated. The filter should include the featured or attached image in the sharing pattern.

    Best regards,
    Ismael

    #718146

    Hi Ismael,
    I had to remove the code as it broke the page. What do you mean by “the function got duplicated”? I still don’t know where to put which code. I hope that there is a solution which adds the post preview picture automatically when someone shares the post on Twitter.
    Thanks for your patience.
    Best,
    Ellie

    #719669

    Hi,

    please provide us ftp access, so we can have a deeper look into this. Post login details here as private reply.

    Best regards,
    Andy

    #719804

    Hi Andy,

    please find the details in the private section. It would be great, if you could have an look at this post. If I try to share it in facebook there is a picture from my instagram account enclosed, which has nothing to do with the pictures in the post. With Twitter I never get any picture.

    Best,
    Ellie

    #721329

    Hi,

    We were able to add the filter in the functions.php file without creating any errors but it’s not working as expected. Do you have some kind of server cache? The same filter is working fine on our installation.

    Best regards,
    Ismael

    #721735

    Hi,

    I have no idea. What exactly do you mean by server cache? How can I find out?

    The only thing I con think of is this bit in the htaccess file:
    <IfModule mod_deflate.c>
    # Compress HTML, CSS, JavaScript, Text, XML and fonts
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE application/x-font
    AddOutputFilterByType DEFLATE application/x-font-opentype
    AddOutputFilterByType DEFLATE application/x-font-otf
    AddOutputFilterByType DEFLATE application/x-font-truetype
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE font/otf
    AddOutputFilterByType DEFLATE font/ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/xml

    # Remove browser bugs (only needed for really old browsers)
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent
    </IfModule>

    Is this of any help? I just removed it, so you can try!

    Best regards,
    Ellie

    • This reply was modified 7 years, 11 months ago by e_zips.
    #722913

    Hi,

    I have no idea. What exactly do you mean by server cache? How can I find out?

    Please ask your hosting provider. If you check the functions.php file, you can see the filter with the var_dump function but it’s not affecting the site. It should at least display NULL if the variable is empty but it’s not doing anything.

    Best regards,
    Ismael

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