Wicked Wordpress - Admin Panel

Hey,

I have been trying to add an Options Panel for my child theme following the book Wicked Wordpress Themes. I have used the same code as in the book, but I cant get the admin Panel to show up in the appearance menu. Anyone know what the problem is and how to fix it?

Thanks!

As far as I’m aware, when the book was published, wordpress 3.0 was the current version of wordpress, rather than the version that is in the wild right now: version 3.2. So, there may be some discrepancies in that regard.

Go ahead and post what code you have.

On my last try I used the excact same code as in the book:

<?php

// Set some theme specific variables for the options panel
$childthemename = “Wicked Theme”;
$childshortname = “wt”;
$childoptions = array();

function childtheme_options() {
global $childthemename, $childshortname, $childoptions;

// Create array to store the Categories to be used in the drop-down select box
$categories_obj = get_categories(‘hide_empty=0’);
$categories = array();
foreach ($categories_obj as $cat) {
$categories[$cat->cat_ID] = $cat->cat_name;
}

$childoptions = array (

array( "name" =&gt; __('Link Color','thematic'),
       "desc" =&gt; __('Change the color of links by entering a HEX color number. (e.g.: 003333)','thematic'),
       "id" =&gt; "wicked_link_color",
       "std" =&gt; "999999",
       "type" =&gt; "text"
),
array( "name" =&gt; __('Show Header Image','thematic'),
       "desc" =&gt; __('Show an image in the header. Replace the header.png file found in the /wicked/images/ folder with your own image, up to 120x100px.','thematic'),
       "id" =&gt; "wicked_show_logo",
       "std" =&gt; "false",
       "type" =&gt; "checkbox"
),
array( "name" =&gt; __('Featured Category','thematic'),
       "desc" =&gt; __('A category of posts to be featured on the front page.','thematic'),
       "id" =&gt; "wicked_feature_cat",
       "std" =&gt; $default_cat,
       "type" =&gt; "select",
       "options" =&gt; $categories
)

);
}
add_action(‘init’, ‘childtheme_options’);

// Make a Theme Options Page
function childtheme_add_admin() {
global $childthemename, $childshortname, $childoptions;

if ( $_GET[‘page’] == basename(FILE) ) {

if ( 'save' == $_REQUEST['action'] ) {
  // protect against request forgery
  check_admin_referer('childtheme-save');
  // save the options
  foreach ($childoptions as $value) {
    if( isset( $_REQUEST[ $value['id'] ] ) ) {
      update_option( $value['id'], $_REQUEST[ $value['id'] ]  );
    } else {
      delete_option( $value['id'] );
    }
  }

  // return to the options page
  header("Location: themes.php?page=options.php&saved=true");
  die;

} else if ( 'reset' == $_REQUEST['action'] ) {
  // protect against request forgery
  check_admin_referer('childtheme-reset');
  // delete the options
  foreach ($childoptions as $value) {
    delete_option( $value['id'] );
  }

  // return to the options page
  header("Location: themes.php?page=options.php&reset=true");
  die;
}

}
add_theme_page($childthemename." Options", “$childthemename Options”, ‘edit_themes’, basename(FILE), ‘childtheme_admin’);
}
add_action(‘admin_menu’ , ‘childtheme_add_admin’)
?>