For a particular project, I’m currently using only wp’s admin and core functions/sugars, so no themes. Still, I’m forced to choose a theme.

I would like a couple of things:

  1. move theme’s functions.php (that currently contains only custom code by me) in /wp-contents, outside the themes and make WP still load it

  2. force WP not to look for themes, so I can succefully delete the themes folder without getting an error in wp-admin

Is this possible? What’s the best way (without hacking the core)?

Point 2 is less crucial, since I can always hide the admin’s themes button. Point 1 is important.

For point 1, maybe I could load functions at the end of wp-config.php, or maybe (still in wp-config) I could hook at ‘init’ or ‘setup_theme’. Or maybe something else.. I’d like to know the best practice here.

thank you

2 Answers
2

I can’t see a reasons why you not just put your code from the functions.php into Plugins or Must Use Plugins, it isn’t that hard to do and is, in my mind preferable, to connecting this task somehow to the wp-config.php.

Besides that, if you don’t absolutely have to remove the backend/admin themes functionality itself, just remove, unset and/or make it inaccessible from the backend/admin area. Seems more practical to me, probably not knowing all the determining factors of course.

Edit: this is complementary to what @ravs suggested

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *