Adding custom fields/options to dashboard pages


I am trying to add a few custom fields to the general settings page on my site’s dashboard, using the code snippet provided here:, and placing it into my roots’ custom.php, but that didn’t work.

Also tried making a separate dashboard page for my custom fields, following this example: , again without any visible effects on my dashboard.

From what I gathered, I think I could use a plugin like Advanced Custom Fields to achieve my goal, but since in some cases I’ll only really need one or two custom fields, I feel like using yet another plugin might be a bit of an overkill, so any help in figuring out how to make one (or maybe even both) of the above examples work with roots, will be much appreciated.

I’ve tried both examples in Roots 7.0.0 and they appear to work fine. The first creates a form towards the bottom of Settings -> General and the other creates Appearance -> Theme Options (with the callback setting up the new forms).

Roots doesn’t make any significant backend changes so you should be fine following any tutorial on this. If you are still having issues, the best way to check if it’s Roots related is to put the code in mu-plugins and try a different theme.

Ok, your answer lead me to dig a little deeper and find my problem was due to a poorly executed ‘upgrade’ from 6.5 to 7.0.
The thing is I started this project just moments before Roots 7.0 came online, so at first I had had git cloned roots 6.5, then made a separate clean install of wordpress with Roots 7.0 and then lazily ended up copying my roots folder over the 6.5 one, on the project I had just barely started, only being aware of the changes to the assets/less file structure, which I corrected at the time, getting rid of the leftover files from 6.5.

Only now I became aware that there were also some changes to lib files, where I believe the file custom.php was replaced by extras.php. Because of my screw-up I had a leftover custom.php where I was inserting my code which wasn’t being loaded anywhere. Now that I tried moving those snippets to extras.php it also seems to be working fine.

Anyway, sorry for kind of wasting your time but you ended up indirectly helping me sort it out, and I hope my experience might be of value for anyone upgrading from 6.5 to 7.0.

1 Like