1

First of all, sorry for not being able to phrase my question correctly.

Then here is my problem - Some days ago I did some changes to my functions.php (one in wp_includes not in theme). I read that I should paste the code in function.php and did it without thinking in wp_includes functions.php.... so is it wrong to make changes in that functions.php ?

Because now, my functions.php (in wp_includes) all my changes have reverted, I don't see the quick edit columns that I added from functions.php in my custom post anymore. This is really a problem for me since it took me long time to setup that code & populate fields etc. For changes, the only actual thing that makes me feel like could have caused this is my caching plugin reason being new functions.php consists some extra lines that setup cache filters or something. The plugin I use is WP Rocket but didn't see any kind of such problems in their forums & I don't want to post this there until I confirm I'm not at fault.

So if anyone has any idea about this, it would be really helpful. Getting back my old functions.php would be my life coming back to my body (not that you guys can do magic, but if I'm missing something important, that would be helpful.)

Thanks in advance, Regards

2

You should not change anything in files inside wp-admin and wp-includes folder.

All these files gets overwritten when WordPress is updated.

The correct functions.php file is in your theme folder. full path to that file: wp-content/themes/YOUR-THEME-FOLDER/functions.php

  • As an alternative, you can create your own plugin, if you'd like your changes to be available even if you switch themes. (The general rule that I follow is that if my code affects the appearance of my site, it should go in the theme's functions.php file; if it affects the functionality of my site, it belongs in a plugin.) – Pat J Apr 24 '17 at 13:54
  • I didn't upgrade my wordpress during this project though. But you still answered a good part of the question Thnx for that mate! – CycloneFire Apr 24 '17 at 18:11
  • WordPress will perform auto-updates, however. – Kenneth Odle Apr 24 '17 at 19:19
  • Also, unless you are using a theme you have written yourself (and are therefore responsible for updating), you should put such code in a child theme's functions.php file. – Kenneth Odle Apr 24 '17 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.