- This topic has 20 replies, 5 voices, and was last updated 1 year, 7 months ago by David.
-
AuthorPosts
-
May 9, 2022 at 5:08 pm #2214633Jan
Hi David,
I’d like to display embedded URLs after the main content of my blog page.
To achieve that I created this Elements hook.
The new section is showing up, but the external content is not being loaded in the same way as the preview of Elements Hook suggests.
What am I missing?
Thanks,
JanMay 10, 2022 at 12:40 am #2214802DavidStaffCustomer SupportHi Jan,
its a known bug, can you try adding this PHP snippet to your site?
add_filter( 'generate_do_block_element_content', function( $content ) { global $wp_embed; $content = $wp_embed->autoembed( $content ); return $content; } );
How to add PHP: https://docs.generatepress.com/article/adding-php/
May 10, 2022 at 3:03 am #2214934JanThanks for getting back, David.
I added the PHP snipped to the function.php of the child theme and cleared browser + server cache.
May I ask you to check the blog page once more?
For some reason the content is still not loading.
Tanks,
JanMay 10, 2022 at 3:20 am #2214947DavidStaffCustomer SupportHmmm… no its not working.
I am going to ask Tom to take a look if that is ok?May 10, 2022 at 2:23 pm #2215655TomLead DeveloperLead DeveloperHi there,
I just gave this a shot and it’s working for me with the code that David shared.
Can you confirm that you’re adding the “Embed” block inside a Block Element and then adding a URL within the block?
Let me know 🙂
May 11, 2022 at 12:40 am #2215915JanHi Tom,
I ran another check but can’t seem to find the issue. This is how I have set up the Block Element.
What puzzles me is that the embedding is working just fine when I add them via sidebar widgets.
Other items I checked: Cookie Banner / Content Blocker for embedded content is not active.
Any other thoughts?
Thanks,
JanMay 12, 2022 at 2:12 am #2217283DavidStaffCustomer SupportSorry for the delay, is it possible to get a temporary admin login to the site so we can see whats going on ?
May 14, 2022 at 1:25 pm #2219747JanHi David,
…sure. I have created an account and shared relevant credentials below.
Best,
JanMay 15, 2022 at 7:34 pm #2220687TomLead DeveloperLead DeveloperI’m not able to see the code in the child theme with that account, but I went into the hook and copied the content, then added it to my site using the same setup (Block Element – Hook –
after_main_content
) and it worked with the snippet active: https://www.screencast.com/t/EhDVZLoAaKiIf your snippet is still active, maybe there’s a conflicting plugin? Can you try deactivating your other plugins one by one to see if there’s a conflict somewhere?
May 16, 2022 at 12:02 am #2220763JanHi Tom,
many thanks for checking this directly on the site.
May I suggest a quick check of the function.php of the child theme for any obvious errors (URL link to the file below)? I suspect the issue has something to do with the custom code from MemberPress. You may remember that CSS stylesheets from the child theme have not been enqueued on course pages.
If that does help, I’ll be more than happy to create a staging environment and run the suggested plugin deactivation tests.
Thanks,
JanMay 16, 2022 at 10:35 am #2221504YingStaffCustomer SupportHi Jan,
I think it would be easier to disable all custom functions and plugins to test.
As sometimes functions that don’t look related are actually affecting each other.
May 24, 2022 at 9:30 am #2231262JanHi Ying,
meanwhile I was able to run the following to trouble shoot the issue:
– Staging environment create
– All non-GP plugins deactivated –> issue remains
– GP child theme replaced by GP Standard theme –> issue remains
– All plugins except GPP deactivated –> issue remainsHave I missed any relevant test scenario?
Thanks,
JanMay 24, 2022 at 11:08 am #2231339YingStaffCustomer SupportHi Jan,
Any chance you can provide the staging site’s admin access so we can do some testing?
Let me know 🙂May 25, 2022 at 1:29 am #2231875JanHi Ying,
sure. The URL-link to the staging site and relevant user credentials can be found in the private text box below.
Please note that you need to use these credentials before getting to the WP login screen. For WP login with admin access, please use the same credentials that I shared with Tom earlier in this ticket.
Can’t wait to hear back from you.
Best,
JanMay 25, 2022 at 2:03 am #2231907Fernando Customer SupportHi Jan,
The theme file editor isn’t viewable from our end, thus we can’t view functions.php file. Can you modify our role to just Administrator?
Temporarily, I tried using GeneratePress Parent Theme, and installed Code Snippets where I added the code provided by David. Upon checking, I can confirm that it works. See: https://share.getcloudapp.com/2Numkr17
Thus, it may be a conflict with another code you have in your Child theme functions.php file that’s causing the issue or it there may be a syntax error.
Kindly let us know.
-
AuthorPosts
- You must be logged in to reply to this topic.