-
AuthorPosts
-
October 5, 2017 at 1:56 am #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.
October 5, 2017 at 11:03 pm #860770Any 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 :-(
October 6, 2017 at 9:06 pm #861184Hi,
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,
BasilisOctober 6, 2017 at 9:14 pm #861186You 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?
October 9, 2017 at 5:05 pm #861986Hi 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,
VictoriaOctober 9, 2017 at 5:26 pm #862003Hi 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.
October 12, 2017 at 4:35 am #863122Hi,
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,
IsmaelOctober 12, 2017 at 12:47 pm #863382Hi Ishmael,
That’s the kind of thing I’m looking for, but it doesn’t seem to work. Check line 229:
October 13, 2017 at 12:12 pm #863886Hi,
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,
IsmaelOctober 13, 2017 at 12:39 pm #863895That worked. Thank you!
October 14, 2017 at 9:10 am #864238 -
AuthorPosts
- You must be logged in to reply to this topic.