Home Forums WoodMart support forum ‘The preview could not be loaded’ when trying to edit HTML blocks

‘The preview could not be loaded’ when trying to edit HTML blocks

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #373528

    luxurybrandbrokers
    Participant

    I am getting an error when trying to edit HTML blocks with Elementor. I get the error:
    The preview could not be loaded. We’re sorry, but something went wrong…’
    I have tried all the suggested ways to fix the issue but it’s still not working. WordPress, Woodmart and all plugins are up-to-date. I’ve tried disabling all other plugins. Checked all hosting settings, etc. It was working when I was building the site on my staging domain. It’s now on actual domain luxurybrandbrokers.com and now it’s not working. I’ve checked all settings and also site and WP urls. Please can you advise how to fix this issue.

    #373554

    Artem Temos
    Keymaster

    Hello,

    Thank you so much for purchasing our theme and contacting our support center.

    Please, disable all external plugins and switch to the parent theme. Then check how it works. If the issue persists, please, keep everything turned off and let us check the problem.

    Kind Regards
    XTemos Studio

    #373773

    luxurybrandbrokers
    Participant

    Thank you for your quick reply. I tried what you suggested and it worked. I then narrowed it down and found that the problem in the child theme was with some of the code I added in the functions.php to add the SKU at the end of the URL. It worked but caused the issue with editing HTML blocks with Elementor. The code is below. Do you have any suggestions on why it would conflict or is there a way to exclude the HTML Block post type from it?

    /**
    * WooCommerce – adds SKU in product URL from wordpress.stackexchange.com/questions/3507/custom-field-values-in-permalink/3517#3517
    */

    function lbb_custom_meta_permalink( $link, $post ){
    $post_meta = get_post_meta( $post->ID, ”, true );
    if( empty( $post_meta ) || !is_string( $post_meta ) )
    $post_meta = ”;
    $link = str_replace( ‘!!custom_field_placeholder!!’, $post_meta, $link );
    return $link;
    }

    add_filter( ‘post_link’, ‘lbb_custom_meta_permalink’, 10, 2 );
    function append_sku_string( $link, $post ) {
    $post_meta = get_post_meta( $post->ID, ‘_sku’, true );
    if ( ‘product’ == get_post_type( $post ) ) {
    $link = $link . ‘#’ .$post_meta;
    return $link;
    }
    }
    add_filter( ‘post_type_link’, ‘append_sku_string’, 1, 2 );

    #374134

    Artem Temos
    Keymaster

    Hello,

    Unfortunately, we don’t know why this code conflicts with Elementor and HTML blocks. Fixing 3rd party code is out of our theme support scope.

    Kind Regards

Viewing 4 posts - 1 through 4 (of 4 total)