• I noticed that Jetpack has support for Twitter Cards, which is excellent. I’d like to edit the value of twitter:site to show my Twitter handle instead of @jetpack, but don’t see any way to do this. Also, all my posts show twitter:card as photo and again I don’t see anywhere to change this.

    Is there a place to change these values that I just haven’t found yet? If not, that definitely seems like something that should be added.

    https://www.ads-software.com/plugins/jetpack/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Yes. I would prefer to use Jetpack for Twitter Cards. However I canot change the meta tags that are included in JetPack version 2.4. It appears with Jetpack 2.4 it has hard-coded Jetpack Twitter account information and it only sends it over as a Photo Twitter Card style.

    I have tried the plug in JM Twitter Cards 3.3.6 but it wants to disabled Jetpack, which I would prefer not to do. Thank you for any information you have.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    I’d like to edit the value of twitter:site to show my Twitter handle instead of @jetpack

    You can customize this value by adding the following code to your theme’s functions.php file:

    function tweakjp_custom_twitter_site( $og_tags ) {
    	$og_tags['twitter:site'] = '@jeherve';
    	return $og_tags;
    }
    add_filter( 'jetpack_open_graph_tags', 'tweakjp_custom_twitter_site', 11 );

    You’ll have to replace my twitter username with your own, of course ??

    all my posts show twitter:card as photo and again I don’t see anywhere to change this.

    Jetpack actually looks for images into your posts:

    • If you didn’t insert any image, the twitter card will be set to “summary”
    • If you insert between 1 and 4 images, the twitter card will be set to “photo”
    • if you insert more than 4 images, the twitter card will be set to “gallery”

    Of course, you’ll welcome to overwrite this default behaviour by adding one more line to the previous code:

    function tweakjp_custom_twitter_site( $og_tags ) {
    	$og_tags['twitter:site'] = '@jeherve';
    	$og_tags['twitter:card'] = 'summary';
    	return $og_tags;
    }
    add_filter( 'jetpack_open_graph_tags', 'tweakjp_custom_twitter_site', 11 );

    Another solution would be to use a different Twitter Card plugin, like JM Twitter Cards as @ab11936 mentioned. You can use both Jetpack and this plugin at the same time. As soon as you activate the plugin, Jetpack’s twitter cards will be deactivated, along with another related Jetpack feature: the Open graph cards used by Facebook. That means that you’d have to install another plugin, like WP Open Graph.

    Jeremy, I inserted the code to the functions.php file in Genesis/Magazine Pro theme. It worked on single or archive pages but broke the home page. Needless to say, I removed the code.

    Could this not be a settable option in JetPack rather than going the route of customizing theme functions? Next time I update the theme these changes will disappear I think, right?

    Cemal

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    We’re working on making this easier to customize in a future release… code being tested and reviewed. ??

    Very good to hear, we’ll wait.

    Cemal

    My twitter connection is not showing cards at all.
    jetpack is installed but I cannot make it post the Summary Large Image card and the twitter validator (https://dev.twitter.com/docs/cards/validation/validatorhttps://dev.twitter.com/docs/cards/validation/validator) gives me an “incorrect card” message every time.

    my site is https://dailyloft.com and twitter acc @dailyloft

    Thanks!

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Hi Mccosha,

    When using the validator, please be sure to enter a page with the card type already set.

    For example, if you validate https://dailyloft.com/2014/05/mechanisms-link-brain-alertness-increased-heart-rate-discovered/ , it will give you an option to approve the Summary Large Image card type.

    Additionally, it looks like your Yoast SEO settings are incorrect for the Twitter creator. It it outputting @https://twitter.com/dailyloft instead of just the Twitter handle.

    If you need anything else, could you please start your own thread, as per the Forum Welcome?

    https://www.ads-software.com/support/plugin/jetpack#postform

    Thank you!

    is this resolved yet??? Dont understand why the goto move for these plugin developers is changing your themes code. This is quite annoying and anything a plugin intends to FORCE the website to do should be made available to alter within the plugin’s settings. Seems like everything with Jetpack has to be corrected by changing code.

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else’s topic.

    I am now closing this 8 month old resolved topic as it references an older version of WordPress.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How to change settings for Twitter Cards?’ is closed to new replies.