I am able to add a video (saved in custom field 'video_url') in instant article, but it is showing on . I need it to appear in instead of the featured image.
The code which I am using to add video in
add_action( 'instant_articles_after_transform_post', function ($ia_post) {
$instant_article = $ia_post->instant_article;
$post_id = $ia_post->get_the_id();
$video_url = get_post_meta( $post_id, 'video_url', true );
$instant_article->addChild(
Facebook\InstantArticles\Elements\Video::create()->withURL($video_url) );
});
I think it may be useful. Advanced Custom Fields can be added all over WP including posts, users, taxonomy terms, media, comments, and even custom options pages!
https://wordpress.org/plugins/advanced-custom-fields/
For detailed documentation - https://www.advancedcustomfields.com/resources/