【发布时间】:2012-06-08 19:05:50
【问题描述】:
我在 Wordpress 中创建了一个“theme-options.php”页面,可以在 WP API“外观”设置菜单下找到该页面。在 this 页面上,我想在 Settings > General-Options 页面( >网站标题和标语/副标题)可以在此处编辑(在我的主题选项页面上)并保存..
我该如何实现这一目标?到目前为止,我有这个,它显示了所需的框和信息,但没有正确保存/更新。我错过了什么?
theme-options.php:
// Build our Page
function build_options_page() {
// Page Structure
ob_start(); ?>
<div class="wrap">
<?php screen_icon();?>
<h2>Theme Options</h2>
<p><b><label for="blogname"><?php _e('Site Title') ?></label></b></p>
<p><input name="blogname" type="text" id="blogname" value="<?php form_option('blogname'); ?>" class="regular-text" />
<span class="description"><?php _e('The name of your site.') ?></span></p>
<br />
<p><b><label for="blogdescription"><?php _e('Tagline or Subheading') ?></label></b></p>
<p><input name="blogdescription" type="text" id="blogdescription" value="<?php form_option('blogdescription'); ?>" class="regular-text" />
<span class="description"><?php _e('A brief description of your site.') ?></span></p>
<p class="submit">
<input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes'); ?>" />
</p>
</div>
<?php
echo ob_get_clean();
?>
}
【问题讨论】:
标签: php html css wordpress themes