Support » Plugin: Twitter » Assigning Default Image for Twitter Card

  • Resolved creativepickle

    (@creativepickle)


    Can the filters (e.g. twitter_card) be used to assign a default image for the large summary card if no post thumbnail is assigned? I am having trouble making this work.

Viewing 1 replies (of 1 total)
  • Plugin Author Niall Kennedy

    (@niallkennedy)

    The twitter_card filter works for me.

    function custom_twitter_card($card_properties) {
    	if ( empty( $card_properties['image'] ) ) {
    		$card_properties['image'] = 'https://example.com/logo.jpg';
    	}
    	return $card_properties;
    }
    add_filter( 'twitter_card', 'custom_twitter_card' );
Viewing 1 replies (of 1 total)
  • The topic ‘Assigning Default Image for Twitter Card’ is closed to new replies.