• Resolved orvn

    (@orvn)


    We have a framework that we’ve built over the years and I’d like to integrate it with Elementor. However, out-of-the-box I get the error described here: https://docs.elementor.com/article/245-preview-could-not-be-loaded

    The preview could not be loaded. 
    We're sorry, but something went wrong.
    • Switching themes fixes the issue, so it’s definitely the theme
    • This theme is just a minimalist boilerplate that we customize to build sites
    • Everything is pretty typical, we use native WordPress objects and methods and usually don’t depart from WP’s principles
    • Page templates all run the normal WordPress loop and inject content using the_content()
    • Flushed the permalinks after activating the theme
    • No plugins are running, issue persists with all plugins disabled
    • PHP memory limit is 96MB, httpd running normally with usual WordPress modules enabled
    • Typical WordPress .htacccess no special rules here
    • Issue persists in incognito mode, server-side cache is not enabled
    • File and directory permissions are normal 644 and 755, SELinux (CentOS) running in permissive mode

    I would really like to get this working with Elementor so we can build it into future themes, but I’m not finding anything to go on for further debugging.

    When I click Edit In Elementor on a page running the default page template, I don’t get any console errors, except maybe some deprecation.

    Elementor System Info dump
    https://pastebin.com/GfHFHGax

    • This topic was modified 6 years, 9 months ago by orvn. Reason: broken tag

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter orvn

    (@orvn)

    • This reply was modified 6 years, 9 months ago by orvn. Reason: not relevant anymore since post html is fixed via edit

    I’d highly recommend php7+ which I believe is also an Elementor min req. – https://docs.elementor.com/article/38-requirements

    Also I try to use no less than 256m memory but rarely even go below 512m while also setting max wp memory often to 2gb+ as we are often doing a lot more than the bare minimum on these websites.

    Sometimes web hosts can block admin-ajax which breaks scripts but you should see it in the browser console if that is the case and yours looks pretty clean.

    Another thing to consider is that they’ll expect the standard wp_head and wp_footer calls to be able to load the dependency styles and scripts with your chosen theme framework.

    Lastly, the Elementor editor, unless setting the page template to one of the built in templates like Canvas or Full-Width, will default to the page/post type defined by your theme. Maybe when editing it is using a template that does not have the wp_content loop?

    Best of luck and success to you!

    • This reply was modified 6 years, 9 months ago by pingram.
    Thread Starter orvn

    (@orvn)

    Thanks for the reply! This is a dedicated server so the good news is that I have a lot of control over the environment; I’ll update to PHP7 and increase memory limits.

    All styles and scripts are enqueued normally and wp_header and wp_footer are called.

    The template I’m looking at is my default page template, which is essentially just the header, the WordPress loop (which injects the_content) and the footer—nothing out of the ordinary there.

    I’m hoping it is as simple as just being on PHP5.

    Thread Starter orvn

    (@orvn)

    It wasn’t that simple *tear*.

    Updated to PHP 7.2.7 and mySQL 5.6.37
    Increased memory to 256MB and 2GB max

    Issue still persists. I hope someone from Elementor can help. I’d like to open a Github issue, but I have no tangible specifics to go on if this is a bug, because nothing is being logged.

    What happens if you go to the back end editor for the page you are trying edit with Elementor and set it to use the Elementor Canvas template?

    Does it still give you the same error?

    If it does, we’ll need to look deeper at your theme and how it is setup, i.e. functions.php and any includes, partials etc that may be built. (may have to enable wp debug logging)

    If it doesn’t produce the error then it is definitely your theme template files and we’d need to look specifically at the one being used, index.php, front-page.php, home.php, page.php, single.php or even some other matching template depending on how you structured your theme.

    A tool I often use is Query Monitor which will provide a drop down debug helper on your front end admin bar when logged in and shows what theme template is being used to render the page.

    When you find it, if you want to provide a Gist we can review the code and see if we can figure it out.

    Thread Starter orvn

    (@orvn)

    Thanks for the reply @pingram3541, somehow I missed it and thought this thread wasn’t getting any responses.

    • Debug mode was enabled, but no errors are logged when I try to load Elementor
    • Issue still persists on the canvas template, or any other page template
    • Query Monitor is very cool, I’m exploring it.

    My default page template page.php is pretty straighforward. The theme is based on FoundationPress and the code for that template looks like this:

    <?php get_header(); ?>
    
    <div class="row">
    	<div class="page-container regular-page small-12 medium-12 large-12 columns" role="main">
    		<div class="main-content small-12 medium-8 large-8 columns">
    			<?php do_action('foundationPress_before_content'); ?>
    
    			<?php while (have_posts()) : the_post(); ?>
    				<article <?php post_class() ?> id="post-<?php the_ID(); ?>">
    								<?php the_breadcrumb(); ?>
    					<header>
    						<h1 class="entry-title"><?php the_title(); ?></h1>
    					</header>
    					<?php do_action('foundationPress_page_before_entry_content'); ?>
    					<div class="entry-content">
    						<?php the_content(); ?>
    					</div>
    					
    					<?php do_action('foundationPress_page_before_comments'); ?>
    					<?php do_action('foundationPress_page_after_comments'); ?>
    				</article>
    			<?php endwhile;?>
    
    			<?php do_action('foundationPress_after_content'); ?>
    		</div>
    		
    		<div class="no-pad small-12 large-4 columns">
    		<?php get_sidebar(); ?>
    		</div>
    		
    </div>
    </div>
    <?php get_footer(); ?>
    

    Even if I remove these four actions, the issue still persists, so those can be eliminated. Meaning it’s unlikely it’s coming from the page template itself.

    do_action('foundationPress_page_before_entry_content')
    do_action('foundationPress_page_before_comments')
    do_action('foundationPress_page_after_comments')
    do_action('foundationPress_after_content')

    Ideas?

    Thread Starter orvn

    (@orvn)

    In fact, even when I remove all the methods like get_header, get_footer and pretty much everything except the WordPress loop and the_content within it, the issue persists.

    By the way, the current theme files can be found here.

    Hi guys, I’ve the elementor free version, and the other day I’ve deleted a category at my shop page and then, when I was about to edit that page with elementor it showed ‘Preview Could Not Be Loaded’ … Now I can edit any other page with elementor, but the shop page I can’t…

    any sugestion?

    TIA

    Thread Starter orvn

    (@orvn)

    First disable all your plugins and see if that fixes it.

    If it doesn’t, it’s probably something in the page template. Open up the template used by that particular page and see if the loop is running and there is a content() area.

    Hi orvn,thanks for your reply…
    should I disable the elementor plugin as well?
    I’m a newbie and this is my first online store, so, if you could be so kind and explain me how can I see if the Loop is running…
    Once again, thank you

    Thread Starter orvn

    (@orvn)

    Nope, disable all plugins except Elementor (my fault for not clarifying that)

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Elementor seems incompatible with my theme “The Preview Cannot be Loaded”’ is closed to new replies.