Title: Problem with Creating Theme Options page
Last modified: August 19, 2016

---

# Problem with Creating Theme Options page

 *  [alfie](https://wordpress.org/support/users/drtanz/)
 * (@drtanz)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/problem-with-creating-theme-options-page/)
 * Hi I m trying to create a theme options page but cannot manage to get the variable
   output in my front end, something must be off, can anyone help me out.
 * This is the code I have in my functions.php
 *     ```
       add_action('admin_menu', 'add_theme_options');
   
       function add_theme_options() {
           add_theme_page(__('Sidebar Banner'), __('Sidebar Banner'), 'edit_themes', basename(__FILE__), 'mitc_banner_url');
       }
   
       function mitc_banner_url() {
           if (isset($_POST['option_submit'])) :
               update_option('banner_url', $_POST['linkurl']);
               echo '<div id="message" class="updated fade"><p><strong>'.__('Options saved.').'</strong></p></div>';
           endif;
       ?>
   
       <div class="wrap">
            <form id="options_form" method="post" action="">
               <h2><?php _e('Banner Link URL'); ?></h2> 
   
               <div class="ui-sortable">
                   <div class="postbox">
                       <h3 class="hndle"><php _e('Sub Header'); ?></h3>
                       <div class="inside">
   
                           <div style="padding:10px;">
                               <div>
                                   <label for="linkurl">Banner Link URL</label>
                                   <input style="width:500px" id="linkurl" />
                               </div>
                               <div class="submit">
                                   <input type="submit" name="option_submit" id="option_submit" value="Update Options" />
                               </div>
   
                               <?php
                               ?>
                           </div>
   
                       </div>
                   </div>
               </div>
           </form>
       </div>
   
       <?php } ?>
       ```
   
 * and this one in my front end:
 *     ```
       <?php
       					   if (get_option("banner_url"))
       					   $banner_url = get_option("banner_url");
       					   echo $banner_url;
       					   ?>
       ```
   

Viewing 1 replies (of 1 total)

 *  [Michelle Langston](https://wordpress.org/support/users/chellycat/)
 * (@chellycat)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/problem-with-creating-theme-options-page/#post-1665985)
 * Your options form has no action…so nothing is happening when it’s submitted. 
   Plus, I don’t see “banner_url” anywhere in the options code…
 * I suggest you read this tutorial which tells you how to create an advanced and
   efficient options page that is scalable should you need to add more options:
 * [http://clark-technet.com/2010/01/wordpress-theme-options-framework-ver-2](http://clark-technet.com/2010/01/wordpress-theme-options-framework-ver-2)

Viewing 1 replies (of 1 total)

The topic ‘Problem with Creating Theme Options page’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [Michelle Langston](https://wordpress.org/support/users/chellycat/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/problem-with-creating-theme-options-page/#post-1665985)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
