• Resolved paulronto

    (@paulronto)


    I’ve just noticed that custom code I’ve added to my Functions and Header PHP was stripped out, I assume in a wordpress/theme update??

    But these are crucial, like my Google Tag Manager code was removed, which holds my analytics code.

    Also some custom styling in my Functions file…

    Why would this happen, and how do I ensure it doesn’t happen in the future. Do I need to turn off automatic theme and WordPress updates? Is there an issue there with security or other site functions if I turn those updates off?

    Thanks.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter paulronto

    (@paulronto)

    Can I use any of these in my wp-config.php to solve this problem?

    Wordpress core updates:
    define( ‘WP_AUTO_UPDATE_CORE’, false );

    Plugins
    add_filter( ‘auto_update_plugin’, ‘__return_false’ );

    Theme
    add_filter( ‘auto_update_theme’, ‘__return_false’ );

    Would I just need to turn off the theme updates to ensure this code is not pulled out again? Any risk of things not working if the theme is not automatically updated?

    Hi @paulronto!

    The changes made in the theme files are overwritten with each update of the theme. We always recommend our users to make these kind of changes only using a child theme, so the changes won’t be lost with future updates. You can find out how to create a child theme here.

    Have a nice day!

    Thread Starter paulronto

    (@paulronto)

    Thanks, I kept hearing about child themes, but I didn’t know what they were or what they did. I will see if I can figure this out without deleting my site… That’s my luck recently.

    Thread Starter paulronto

    (@paulronto)

    Ok looks like i was able to download and install the child theme, now what?

    Hello @paulronto!

    After installing and activating the child theme, you should locate the “views” folder inside Neve (in the root of the folder) and copy it inside the child theme’s folder. Then, you can make any changes you need in the views folder of the child theme. Also, make sure you save the changes. Please note that at the moment it’s possible to make changes within the child theme only for files that can be found inside that “views” folder.

    Have a nice day!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom code being stripped from PHP’ is closed to new replies.