I'm pretty new to Wordpress development but say I want, based on my theme's page template I want to create a custom variable.
Ultimately the idea is to create a variable that appears as a field on the admin's post page. That variable can be called in my theme.
As a use case I have buttons on a site that I'd like different colors based on different pages. In making or editing a page I'd like to add a hex for the color in a custom field that inputs that code into the final html page.
I haven't found anything similar to this online. Any help would be appreciated.