acorn
acorn copied to clipboard
Bug: Custom embeds for any post type don't work
Terms
- [X] I have read the guidelines for Contributing to Roots Projects
- [X] This request is not a duplicate of an existing issue
- [X] I have read the docs and followed them (if applicable)
- [X] I have seached the Roots Discourse for answers and followed them (if applicable)
- [X] This is not a personal support request that should be posted on the Roots Discourse community
Description
What's wrong?
Embeds are using the fallback HTML element (Blockquote), instead of the iframe, when being rendered on the frontend of my post/page. ** The embeds are being shown in the iFrame and work as intended on the editor (Gutenberg) though**.
What have you tried?
- Creating templates for embed-post.blade.php (what I need), embed.blade.php, embed-404.blade.php and etc.
- Moving those templates in the folder hierarchy of the theme.
- Using .php only instead of .blade.php
What insights have you gained?
Embeds work in the editor (using Gutenberg), but not the frontend.
Possible solutions
None
Temporary workarounds
- add_filter( 'the_content', '_oembed_filter_feed_content' );
- Possible manually removing the 'position: absolute; ...' on the iFrame, and hiding the Blockquote.
Steps To Reproduce
- Create a WP project ( I am using Laravel Valet )
- Set up a blank Sage 10 theme.
- Create a embed-post.blade.php in the /views subfolder with any dummy HTML.
- Copy the link of any post, and try to paste in another post or page. Publish this page.
- Embed template preview shows on the Editor, but if you visit the post/page you've created you will only see the Blockquote fallback with the title of the post you copied.
Expected Behavior
Get the iFrame of the template embed I've created on the post I've just published.
Actual Behavior
Getting the Blockquote fallback, iFrame is hidden.
Relevant Log Output
No response
Versions
Sage v10.1.16 macOs v12.1 PHP v7.4