Support » Theme: Neve » Error that switches theme to default

  • Resolved Silvina Furnadzhieva

    (@silvinafurnadzhieva)


    Hello! I installed Neve on my site but encountered a problem: every 60 minutes WordPress automatically deactivates the theme and replaces it with the default one. If I try removing the following code:

    function _neve_bootstrap_errors() {
    global $_neve_bootstrap_errors;
    printf( '<div class="notice notice-error"><p>%1$s</p></div>', $_neve_bootstrap_errors->get_error_message() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    }
    
    if ( $_neve_bootstrap_errors->has_errors() ) {
    /**
    * Add notice for PHP upgrade.
    */
    add_filter( 'template_include', '__return_null', 99 );
    switch_theme( WP_DEFAULT_THEME );
    unset( $_GET['activated'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    add_action( 'admin_notices', '_neve_bootstrap_errors' );
    
    return;
    }

    from functions.php, I get the following error message in the WordPress error log:

    PHP Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) in /home/silvinab/public_html/wp-content/themes/neve/globals/utilities.php on line 554

    Can you please advise how to fix this?

    If you need information on the PHP install and setup, it’s available here.

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • Hi @silvinafurnadzhieva,

    Thanks for choosing Neve!

    Usually, this happens if changes were made in the theme files and there is some kind of mistake in them. If that’s the case, please remove the changes made and check if the issue persists. We always recommend making any desired changes or customization in the files using a child theme so the actual theme files won’t be changed and also the changes made won’t be overwritten with future updates of the theme. You can find out more about the child theme here.

    I hope this helps!

    Thread Starter Silvina Furnadzhieva

    (@silvinafurnadzhieva)

    Hi! I haven’t made any changes, otherwise I would have told you what they are. The only thing I did after I installed the theme was import a sample site, with no edits from me.

    Hi @silvinafurnadzhieva,

    Thanks for clarifying!

    This is indeed an odd behavior. However, it’s not recommended to remove any code from the theme files as you tried to do with that piece of code provided above. Could you please try to backup your site and make a fresh install of Neve?

    Thanks!

    Thread Starter Silvina Furnadzhieva

    (@silvinafurnadzhieva)

    I realized what you advise is wrong, so I put the code back after performing the test you described. That didn’t help. Also, I already did about 3 fresh reinstalls of Neve, and that didn’t fix the issue either. I also tried turning all plugins on and off, all at once and one by one, to see if there’s a plugin conflict but that didn’t seem to help either. The only thing I know is that it doesn’t seem to be a plugin conflict.

    What seems to cause the problem is any theme settings I change through the WordPress dashboard. If I change the font, for example, which I suppose makes changes to the theme’s CSS files, this odd behaviour starts. I need to change settings, however – I would like to use a font different than the default, for example, so if we assume that’s the issue, I’ll need a solution. Please note I’m not editing the CSS directly – I’m only doing it through the theme’s options, as I’m supposed to do.

    Of course, there might be another issue causing this – I just assume that might be the reason.

    Please let me know what I can do to resolve the issue.

    Kush

    (@kushnamdev)

    Hey @silvinafurnadzhieva ,

    Thank you for using Neve and I’m sorry to hear about the difficulties encountered.

    If the problem persists, you can try to install this plugin and assume the theme reverts to the default one due to an error, with the help of this plugin, you should find the error. In case it’s something generic caused by the theme, you can share the error with us.

    Thanks and have a great day!

    Thread Starter Silvina Furnadzhieva

    (@silvinafurnadzhieva)

    Hello! This is the error I get:

    PHP Fatal error: Cannot use isset() on the result of an expression (you can use “null !== expression” instead) in /home/silvinab/public_html/wp-content/themes/neve/globals/utilities.php on line 554

    Hi @silvinafurnadzhieva!

    Could you please update to the latest version of Neve (3.4.5) and check if the issue persists?

    Thanks!

    Thread Starter Silvina Furnadzhieva

    (@silvinafurnadzhieva)

    Hi again! I updated and the issue persists. Please advise me on what to do next.

    Hi @silvinafurnadzhieva!

    Do you use the new skin of the theme that was introduced with version 3.0 or do you use the legacy one? Also, could you please submit this form? This way we’ll be able to get more information about your WordPress instance and server limitations to understand the root cause of this issue better.

    Thank you!

    Thread Starter Silvina Furnadzhieva

    (@silvinafurnadzhieva)

    Hi! I haven’t changed skins and I’m using the latest theme version as advised, so I guess I’m using the new skin. I’ll also fill in the form shortly.

    Theme Author Themeisle

    (@themeisle)

    Hi @silvinafurnadzhieva,

    Thank you for filling the form, we have successfully received it.

    Can you please migrate to the Neve 3.0 as per this documentation?
    https://docs.themeisle.com/article/1388-neve-3-0-core-design

    There are 2 steps – first, migrate it in Header builder and then switch to Style 3.0.

    Let us know how it goes. Thanks!

    Thread Starter Silvina Furnadzhieva

    (@silvinafurnadzhieva)

    Hi again!

    I followed the instructions available at the following address:

    https://docs.themeisle.com/article/1388-neve-3-0-core-design

    The first one recommended in the documentation is to migrate the so-called Header builder. I accessed WordPress admin -> Appearance -> Themes -> Settings under Neve theme -> Header. In the open options, there is none that can perform Header Builder actions.

    In the main settings of the theme, there is no menu named Style from where to make the change. Further down in the documentation I understand that this menu is only available if the Pro (paid) version of the theme is used and this functionality is implemented by installing an additional plugin called Neve Pro.

    Here it is important to clarify that at the beginning of the communication, according to what I remember, the theme version was 3.4.3. The site uses the free version of the Neve theme.

    I’ve updated to the latest free version but that still isn’t solving the issue. Please advise me how to proceed further.

    Hi @silvinafurnadzhieva!

    The Header Builder can be found in the Customizer, by going to Appearance -> Customize -> Header – screenshot1, screenshot2, not from the settings within the dashboard. The Style tab can be found in the Customizer as well, under the Additional CSS tab and it is available in the free version as well, not just in the Pro one.

    Thread Starter Silvina Furnadzhieva

    (@silvinafurnadzhieva)

    I just made yet another attempt to find these options and I don’t have them where you say they should be. This, I assume, means that everything is set up correctly and the theme is updated but I’m still having the issue.

    Should I assume you don’t really want to help me and I should switch to another theme from a different developer, or are you able to provide a solution?

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Error that switches theme to default’ is closed to new replies.