Title: Simple?! Custom Variable in a Template
Last modified: August 19, 2016

---

# Simple?! Custom Variable in a Template

 *  [gegenalles](https://wordpress.org/support/users/gegenalles/)
 * (@gegenalles)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/simple-custom-variable-in-a-template/)
 * Hi,
 * maybe someone can help me.
 * Isn’t it as simple as it sounds? I tried around with the Functions.php, but without
   success.
 * I would like to add a form in the admin-area of my template (just like the header-
   image-page in the kubrick-theme.
 * The “user” should be able to change a value and this value should be accessible
   from the template.
    E.g. changing a “welcome” message without having to change
   the code.
 * Someone any idea?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Mark](https://wordpress.org/support/users/wpsec/)
 * (@wpsec)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/simple-custom-variable-in-a-template/#post-967323)
 * Look at how Kubrick handles putting a menu item on the screen to navigate to 
   the theme header settings page, how it puts a form on the screen and stores the
   values when the form is submitted. It’s pretty straight forward to do that sort
   of thing – assuming that you’re familiar with HTML forms, PHP, storing values
   in the WP database, etc.
 * You might want to tell us what theme you’re trying to work with? Or it is your
   own custom theme?
 * Either way the easiest approach is to copy something that works and modify it
   for your own needs.
 *  Thread Starter [gegenalles](https://wordpress.org/support/users/gegenalles/)
 * (@gegenalles)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/simple-custom-variable-in-a-template/#post-967353)
 * Thank you.
 * I use the kubrick-theme but it is heavy modified.
    That’s what I did, i looked
   up Kubrick’s functions.php. I know how to work with template tags, custom fields
   etc. The functions.php however is not very easy to understand.
 * Ok, they use color pickers, etc. and I only need 2 Text-Forms. Shouldn’t that
   be quite simple?
 * I need to tell wordpress to:
    Create a Admin Page Create 2 Labels, 2 Text-Boxes
   and one submit-button. Store the content of Text-Boxes in Database
 * Then there should be a template tag or something that lets me embed the text 
   in the template.
 * Thanks to someone who could give me a hint.
 * > Either way the easiest approach is to copy something that works and modify 
   > it for your own needs.
 *  [Mark](https://wordpress.org/support/users/wpsec/)
 * (@wpsec)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/simple-custom-variable-in-a-template/#post-967409)
 * Here’s the basis of getting a menu item in the nav for theme options. This is
   extremely basic code that you will need to expand upon. If you need to hire someone
   do all this for you then you could contact me privately via my Web site or join
   the WP Pro list and hire someone there.
 *     ```
       <?php
       add_theme_page("New Options", "New Options", 'edit_themes', basename(__FILE__), 'my_new_options);
   
       function my_new_options() {
       echo 'hello';
       // put your HTML form here and whatever processing
       // code you need to grab submitted form vars
       // and store them in the database somewhere
       }
       ?>
       ```
   
 *  Thread Starter [gegenalles](https://wordpress.org/support/users/gegenalles/)
 * (@gegenalles)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/simple-custom-variable-in-a-template/#post-967451)
 * Thanks again, I’ve got it now!
    I had to look for Plugin-Development, not for
   Theme Development.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Simple?! Custom Variable in a Template’ is closed to new replies.

## Tags

 * [custom value](https://wordpress.org/support/topic-tag/custom-value/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * 4 replies
 * 2 participants
 * Last reply from: [gegenalles](https://wordpress.org/support/users/gegenalles/)
 * Last activity: [17 years, 4 months ago](https://wordpress.org/support/topic/simple-custom-variable-in-a-template/#post-967451)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
