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.

1 Answer 1


Yes, custom fields or meta fields are part of WordPress. There are all information you need.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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