X Pro v4.0.9 - Cornerstone crashing for no reasons

Hi,

Find here the video of the problem: https://youtu.be/daCO3qPXcnk

Hi @lijecreative,

Thanks for reaching out.

There could be a plugin or custom code that trigger to crash your website.

I recommend the following troubleshooting procedures before we investigate the settings.

  1. TESTING FOR THEME RELATED ISSUE
  2. TESTING FOR PLUGIN CONFLICT
  3. THEME UPDATE
  4. CHILD THEME
  5. CSS/JS CUSTOMIZATION
  6. VERSION COMPATIBILITY

Only if none of that helps, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password

You can find the Secure Note button at the bottom of your posts.

Thank you.

Hi,

I’m using a child theme. My custom js and css are not loaded in cornerstone.
I got only 7 plugins.
The bug is really random.

Hello @lijecreative,

Thanks for sharing the credentials. I went ahead and checked your site’s dashboard. It seems that there is some issue in your child theme because of that the builder is not working properly. After activating the parent theme it works fine. Please find the video in the secure note.

Please note that we don’t provide customized child theme support. It is out of the support scope.

Thanks for understanding.

Hi,

The bug occurs when you add “inside-link” as class in a column or a section.

In my custom.js, it does this:

$(document).on('click', '.inside-link', function (e) {
    window.location.replace($(this).find('a').attr('href'));
});

But my custom.js is not loaded in the page since i’m using:

function custom_scripts()
{
    wp_dequeue_style('x-child');

    wp_register_style('theme-styles', get_stylesheet_directory_uri() . '/style.css', array(), filemtime(get_stylesheet_directory() . '/style.css'), 'all');
    if (!isset($_POST['cs_preview_state']) || !$_POST['cs_preview_state'] || 'off' === $_POST['cs_preview_state']) {
        wp_enqueue_style('theme-styles');
    } else {
        wp_dequeue_style('theme-styles');
    }

    wp_register_script('custom-script', get_stylesheet_directory_uri() . '/custom.js', array(), filemtime(get_stylesheet_directory() . '/custom.js'), true);
    if (!isset($_POST['cs_preview_state']) || !$_POST['cs_preview_state'] || 'off' === $_POST['cs_preview_state']) {
        wp_enqueue_script('custom-script');
    } else {
        wp_dequeue_script('custom-script');
    }
}

add_action('wp_enqueue_scripts', 'custom_scripts', 99);

It’s probably linked to something else, a bug or something. I used these snippet on so many websites and it never bugged.

Hi @lijecreative,

I have created a new page added a section with the class inside-link, but nothing happened as mentioned in your posts. If that is not the case and you are trying to point out something else, please provide any screenshot marked with the issue or any video that helps us to recognize the problem.

Thanks

Hi,

Do it again, it was working on it so I had to disable the redirection.

Hey @lijecreative,

I checked your setup and your custom JS file is also being loaded inside the Builder (see screenshot)

This is the reason why the builder crashes when you add inside-link class in an element. Please remove or modify the Custom JS to fix the issue.

Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X/Pro will need to be directed to the original developer.

Thank you for your understanding!

I can’t see it:

You provided me this snippet a while ago and it still seems to work:

    if (!isset($_POST['cs_preview_state']) || !$_POST['cs_preview_state'] || 'off' === $_POST['cs_preview_state']) {
        wp_enqueue_script('custom-script');
    } else {
        wp_dequeue_script('custom-script');
    }

The current loader use the same post variable.

Hello @lijecreative,

Can you please switch to the parent theme? This is to make sure that you are only experiencing the issue when using the child theme. There are several custom PHP codes in your child theme’s functions.php file. One of those lines could be causing the issue. You need to temporarily remove the PHP code blocks one by one. You’ll know that a certain PHP block is causing it when it is removed from your child theme’s functions.php file.

See the secure note below.

Thanks.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.