Forums
Home / Plugin: Twitter / Assigning Default Image for Twitter Card
(@creativepickle)
8 years, 2 months ago
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.
(@niallkennedy)
7 years, 9 months ago
The twitter_card filter works for me.
twitter_card
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' );