'Left widgets',
'before_widget' => '',
'after_widget' => '',
'before_title' => '
',
'after_title' => '
',
));
register_sidebar(array(
'name' => 'Right widgets',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
}
/* Add our theme customisation options */
add_option('anna_theme_image', get_bloginfo('template_directory') . '/demoimage.jpg'); // Used for header image, otherwise fall back to text
add_option('anna_theme_description', 'This is demonstration text for the Anna theme. You can edit this under the \'Configure Theme\' option in the Admin panel. This will only show on the home page and is good for things like introduction boxes. If you don\'t like it, then remove this text to completely get rid of the intro box!.'); // The description for the home page info box
add_option('anna_theme_header_image', get_bloginfo('template_directory') . '/demoheader.png'); // The image for the home page info box
add_action('admin_menu', 'anna_theme_add_pages');
function anna_theme_add_pages()
{
add_theme_page('Configure Theme', 'Configure Theme', 'edit_themes', 'functions', 'anna_theme_configure');
}
function anna_theme_admin_header()
{
wp_enqueue_script( 'common' );
wp_enqueue_script( 'jquery-color' );
wp_print_scripts('editor');
if (function_exists('add_thickbox')) add_thickbox();
wp_print_scripts('media-upload');
if (function_exists('wp_tiny_mce')) wp_tiny_mce();
wp_admin_css();
wp_enqueue_script('utils');
do_action("admin_print_styles-post-php");
do_action('admin_print_styles');
}
add_action('admin_head', 'anna_theme_admin_header');
function anna_theme_configure()
{
// Limit option settings
if (!current_user_can('edit_themes'))
{
die('Access Denied');
}
$updated = false;
// Handle post responses
if (isset($_POST['anna_theme_description']))
{
update_option('anna_theme_description', stripslashes($_POST['anna_theme_description']));
$updated = true;
}
if (isset($_POST['anna_theme_image']))
{
update_option('anna_theme_image', $_POST['anna_theme_image']);
$updated = true;
}
if (isset($_POST['anna_theme_header_image']))
{
update_option('anna_theme_header_image', $_POST['anna_theme_header_image']);
$updated = true;
}
?>
Configure Theme
Options saved.
';
}
?>