[Resolved] GPP / Elements hook / Embedded page

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

Home Forums Support GPP / Elements hook / Embedded page

Viewing 15 posts - 1 through 15 (of 21 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.

    #2231262
    Jan

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

    Have I missed any relevant test scenario?

    Thanks,
    Jan

    #2231339
    Ying
    Staff
    Customer Support

    Hi Jan,

    Any chance you can provide the staging site’s admin access so we can do some testing?
    Let me know 🙂

    #2231875
    Jan

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

    #2231907
    Fernando
    Customer Support

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

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