- This topic has 11 replies, 4 voices, and was last updated 3 years, 3 months ago by
Tom.
-
AuthorPosts
-
February 20, 2023 at 8:19 am #2540070
melonbird
I’m seeing a noticeable gap on mobile view only after adding a custom HTML or embed block to a post. I’ve tried removing all custom CSS and turning off all plugins, and that didn’t fix it. Switching to any of several other themes does fix it. I included a test page example in Private Info.
February 20, 2023 at 10:18 am #2540214David
StaffCustomer SupportHi there,
if you create your own generic iframe using this site:
Do they work correctly ?
As the core embed block has its issues with responsiveness
February 20, 2023 at 10:55 am #2540254melonbird
I’m not sure if I understand how to test it. I put my embed link into the Generic Iframe tab, clicked embed, and pasted the code it produced into my Custom HTML block. But it just showed the code instead of any actual embedded content.
February 20, 2023 at 11:54 am #2540335Ying
StaffCustomer SupportBut it just showed the code instead of any actual embedded content.
The link David provided seems don’t have the option for Pinterest, you can try Pinterest’s official widget builder:
https://developers.pinterest.com/tools/widget-builder/?type=pinYou can use a hook element to insert the JavaScript, and choose
wp_footeras the hook name.February 20, 2023 at 12:55 pm #2540372melonbird
Okay, that one didn’t have the gap. So how do we fix the theme, since this is only happening with GP?
February 20, 2023 at 1:16 pm #2540394Ying
StaffCustomer SupportSo how do we fix the theme, since this is only happening with GP?
I don’t think it’s a theme issue. Just in case, can you switch back to the way you used before so I can take a closer look at the iframe coding?
February 20, 2023 at 1:23 pm #2540403melonbird
Done.
I’m confused because I tried several other themes and it was fine with all of them. I turned off all plugins, deleted my custom CSS, and none of that helped. If I switch themes, I can embed with either the Pinterest block or the custom html and not get that gap.
February 20, 2023 at 8:51 pm #2540677Tom
Lead DeveloperLead DeveloperHi there,
I’m seeing a javascript error on the page that could cause the issue you’re seeing: https://www.screencast.com/t/gwASqhrZrKV
It seems to be coming from a TOC plugin: https://www.screencast.com/t/m6h7SjK1Oq
Can you deactivate that plugin so we can inspect the gap without any JS errors?
Thanks!
February 21, 2023 at 5:41 am #2541108melonbird
Done. Didn’t help.
As I said in the first post, I already tried deactivating all plugins removing the custom CSS and it didn’t help. Also the TOC plugin is not on the other GP site where I’m seeing this same behavior. The only thing that fixes it is switching to any other theme. I’ve tried several and am not seeing this problem with other themes.
February 22, 2023 at 8:30 pm #2543428Tom
Lead DeveloperLead DeveloperHi there,
I added this Pinterest embed to my development server and tried it with TwentyTwenty Three, Two and One to see what those core themes did.
Only TwentyTwentyOne didn’t have the space you’re seeing (the other two did). I took a look at why and it looks like they’re using a custom javascript file to add the inline width/height: https://raw.githubusercontent.com/WordPress/twentytwentyone/trunk/assets/js/responsive-embeds.js
What you can do is:
1. Save the above linked file.
2. Upload it to your website – you will have to add it to your child theme or somewhere on the site using an FTP program.
3. Add the following function:add_action( 'wp_enqueue_scripts', function() { wp_enqueue_script( 'responsive-pins', 'THE URL TO YOUR FILE ON YOUR SITE HERE' ); } );Let us know if you need more info 🙂
March 2, 2023 at 9:15 am #2553016melonbird
Sorry, I thought I replied to this before. Thank you for researching this and figuring it out for me. I really appreciate the support you guys provide.
March 2, 2023 at 8:44 pm #2553536Tom
Lead DeveloperLead DeveloperGlad we could help! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.