This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ...snip | |
// Change Yoast og:type and add og:video meta tags for a custom post type in WordPress | |
// Note: This assumes you are using a custom field named 'youtube_id' using Advanced Custom Fields plugin | |
// Change og:type of episodes and videos to video | |
function yoast_change_opengraph_type( $type ) { | |
// If this is the wanted custom post type | |
if ( get_post_type() == 'episode' ) { | |
return 'video'; |