Ali Bhutta
Ali Bhutta

Reputation: 499

Preview could not be loaded issue/error in elementor

I'm working with a custom template and when I try to open any page in elementor plugin after selecting my template for that page, it shows me an error: "preview could not be loaded" and I have to enable safe mood in order to open that page in the elementor.

Template code:-

<?php 
/**
    Template name: Master Template  
*/
wp_head();
get_header();
?>

<body>
    
<?php 
if(have_posts()):
    while(have_posts()):
        the_post();
        the_content();
    endwhile;
endif;
?>
</body>

<?php 
get_footer();
?>

I found 2 solutions regarding this Solution 1:-

Before going further, 99% of the time, this error usually caused by running out of memory. To resolve this, you must increase the PHP memory_limit variable. The recommended memory limit is 512MB. Do this.

Solution 2:-

Deativate all plugins and activate them one by one to see if one of them is conflicting

These solutions didn't work for me, regarding solution 1 I already have memory_limit 512MB and regarding solution 2 There is only 1 plugin activate that is elementor. What should I do to get rid of this error? Is there something I'm missing?

Upvotes: 1

Views: 1328

Answers (1)

Ali Bhutta
Ali Bhutta

Reputation: 499

I got my solution:-

The error vanished as I changed my current theme, I was using the theme: Twenty Twenty but when I changed it from Twenty Twenty to Twenty Seventeen the error was gone and my plugin elementor started working like a charm.

When I debugged it deeply I came to know that I didn't use wp_footer() with get_footer(), as I used this function(in old/using theme), issue was vanished.

Code is below:-

<?php 
/**
    Template name: Master Template  
*/
wp_head();
get_header();
?>

<body>
    
<?php 
if(have_posts()):
    while(have_posts()):
        the_post();
        the_content();
    endwhile;
endif;
?>
</body>

<?php 
get_footer();
wp_footer();
?>

Hope it'll help someone.

Upvotes: 1

Related Questions