Figured the XML, added the following to functions.php
function xhtml_please() {
return ‘xml’;
}
add_filter(‘twitter_cards_htmlxml’, ‘xhtml_please’);
I think there might be a typo in the readme: “twitter_card_properties” should be “twitter_cards_properties”.
To add a Twitter field to the user contact details and have this included in the twitter card you need the following:
function include_site_and_creator_details($array) {
global $post;
$user_ID = $post->post_author;
$user_data = get_user_meta($user_ID, ‘twitter’, true);
if ($user_data != ‘’) {
$array[‘creator’] = $user_data;
}
// comment out this next line if you don’t want a site
$array[‘site’] = ‘@sitename’;
return $array;
}
add_filter(‘twitter_cards_properties’, ‘include_site_and_creator_details’);
function extra_contact_info($contactmethods) {
$contactmethods[‘twitter’] = ‘Twitter’;
return $contactmethods;
}
add_filter(‘user_contactmethods’, ‘extra_contact_info’);