[Support request] GPP / Elements hook / Embedded page

Home Forums Support [Support request] GPP / Elements hook / Embedded page

Home Forums Support GPP / Elements hook / Embedded page

  • This topic has 10 replies, 4 voices, and was last updated 1 week ago by Ying.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2214633
    Jan

    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,
    Jan

    #2214802
    David
    Staff
    Customer Support

    Hi 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/

    #2214934
    Jan

    Thanks 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,
    Jan

    #2214947
    David
    Staff
    Customer Support

    Hmmm… no its not working.
    I am going to ask Tom to take a look if that is ok?

    #2215655
    Tom
    Lead Developer
    Lead Developer

    Hi 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 🙂

    #2215915
    Jan

    Hi 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,
    Jan

    #2217283
    David
    Staff
    Customer Support

    Sorry for the delay, is it possible to get a temporary admin login to the site so we can see whats going on ?

    #2219747
    Jan

    Hi David,

    …sure. I have created an account and shared relevant credentials below.

    Best,
    Jan

    #2220687
    Tom
    Lead Developer
    Lead Developer

    I’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/EhDVZLoAaKi

    If 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?

    #2220763
    Jan

    Hi 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,
    Jan

    #2221504
    Ying
    Staff
    Customer Support

    Hi 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.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.