Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Custom embeds for any post type don't work #325

Open
5 tasks done
KIKOmanasijev opened this issue May 5, 2022 · 3 comments
Open
5 tasks done

Bug: Custom embeds for any post type don't work #325

KIKOmanasijev opened this issue May 5, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@KIKOmanasijev
Copy link
Contributor

KIKOmanasijev commented May 5, 2022

Terms

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

  1. Create a WP project ( I am using Laravel Valet )
  2. Set up a blank Sage 10 theme.
  3. Create a embed-post.blade.php in the /views subfolder with any dummy HTML.
  4. Copy the link of any post, and try to paste in another post or page. Publish this page.
  5. 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

@KIKOmanasijev KIKOmanasijev added the bug Something isn't working label May 5, 2022
@KIKOmanasijev
Copy link
Contributor Author

Bump.

I still haven't found a solution to fix this. When I create a embed-{post-type}.blade.php, and use the embed in the editor I can see it works. The problem is that the embed is hidden by default on the site with "position: absolute; clip: rect(1px, 1px, 1px, 1px);"

@Log1x Log1x transferred this issue from roots/sage Jan 5, 2024
@trajche
Copy link
Contributor

trajche commented May 26, 2024

Has anyone been able to figure this out?

@Log1x
Copy link
Sponsor Member

Log1x commented May 26, 2024

Does removing https://github.com/roots/sage/blob/main/app/setup.php#L40 change anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants