Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #860366

    Hi,

    When I embed a YouTube into a post (not using the advanced page editor), Enfold adds the following code around it:

    <div class='avia-iframe-wrap'><iframe width="1500" height="844" src="https://www.youtube.com/embed/cKh3cGf1_B0?feature=oembed" frameborder="0" allowfullscreen></iframe></div>
    </div>

    The addition of the extra <div class=’avia-iframe-wrap’> tag breaks the display of the video on Facebook Instant articles. Is there a way to remove this tag?

    • This topic was modified 7 years, 3 months ago by sparkzilla.
    #860770

    Any chance of a reply on this? It’s causing me a lot of trouble. I’d like to continue using Enfold for the client, but I’ll have to switch to another theme if it doesn’t get fixed :-(

    #861184

    Hi,

    I do not think that you can play the videos from a page inside ( actually I am sure ) direct from the page as embed to facebook.
    That is now braking from us, there is no FB support for that.

    Best regards,
    Basilis

    #861186

    You can play YouTube videos on Instant Articles. I have done it many times. The issue is — as described above– that Enfold adds the <div class=’avia-iframe-wrap’> tag to any videos that are embedded in the edit window. This tag generates an error in Instant Articles. When I remove it manually the video plays fine.

    So it’s not an FB error. Can you tell me how to remove the tag?

    #861986

    Hi sparkzilla,

    An html tag cannot generate an error, unless it does not have a closing tag for some reason. Is that the case?

    Best regards,
    Victoria

    #862003

    Hi Victoria,

    Facebook’s Instant Articles work by presenting a stripped-down version of a web page to Facebook’s mobile users. This page appears “instantly’ when the link is clicked on Facebook’s newsfeed

    In practice, articles are exported from WordPress into Instant Articles using an RSS feed. The RSS feed is parsed by the Instant Articles system and the article is constructed on Facebook. The RSS feed is very simple, and does not accept certain types of content.

    The problem in this case is that Enfold adds extra tags around any video content (<div class=’avia-iframe-wrap’>VIDEO CONTENT </div>) which breaks the Instant Articles parser. If this tag is removed manually the parser can read the video; if not, then it generates an error.

    As we are processing a lot of articles that have embedded video, we need to remove the opening and closing tags.

    #863122

    Hi,

    The addition of the extra

    tag breaks the display of the video on Facebook Instant articles. Is there a way to remove this tag?

    Yes, this is possible but this may distort the video containers a bit or it may not resize correctly. Add this code in the functions.php file.

    remove_filter( 'embed_oembed_html', 'avia_iframe_proportion_wrap', 10, 4 );
    

    Best regards,
    Ismael

    #863382

    Hi Ishmael,

    That’s the kind of thing I’m looking for, but it doesn’t seem to work. Check line 229:

    view-source:https://mediabub.com/john-kavanagh/mcgregors-coach-kavanagh-hits-the-deck-after-getting-too-confident-on-hoverboard/

    #863886

    Hi,

    Please replace the code with the following.

    add_action( 'init', 'ava_init_mod_23213434324', 100 );
    function ava_init_mod_23213434324() {
        remove_filter( 'embed_oembed_html', 'avia_iframe_proportion_wrap', 10, 4 );
    }

    Best regards,
    Ismael

    #863895

    That worked. Thank you!

    #864238

    Hi,

    Great, glad we could help. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.