我只是把这个放在我的function.php
文件:
<?php
// Run the scripts for triggering the below functions
add_action(\'admin_menu\', \'cms_options_menu\');
function cms_options_menu() {
//create new top-level menu
add_menu_page(\'CMS options\', __(\'CMS options\'), \'administrator\', __FILE__, \'cms_options_page\',plugins_url(\'/images/icon.png\', __FILE__));
//call register settings function
add_action( \'admin_init\', \'register_custom_fields\' );
}
function register_custom_fields() {
//register our settings
register_setting( \'cms-options\', \'slogan\' );
}
function cms_options_page() {
?>
<form method="post" action="options.php">
<table class="form-table">
<tr valign="top">
<td scope="row">
<?php _e(\'Slogan\'); ?>
</td>
<td>
<input type="text" name="slogan" value="<?php echo get_option(\'slogan\'); ?>" />
</td>
</tr>
</table>
<p class="submit">
<input type="submit" class="button-primary" value="<?php _e(\'Save Changes\') ?>" />
</p>
</form>
<?php } ?>
然后,您只需添加所需的任何文本并保存更改。