Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup_theme_admin_menus() {
- add_submenu_page('themes.php',
- 'Front Page Elements', 'Front Page', 'manage_options',
- 'front-page-elements', 'theme_front_page_settings');
- }
- function theme_front_page_settings() {
- ?>
- <form method="POST" action="">
- <h1>Google Webmaster Tools</h1>
- <input type="text" name="wmt-code" value="<?php echo get_option("theme_wmt");?>"/>
- <h1>Google Analytics Code</h1>
- <textarea name="ga-code" rows="7" cols="50" /><?php echo get_option("theme_ga");?></textarea>
- <input type="hidden" name="update_settings" value="Y" />
- </form>
- <?php
- if (isset($_POST["update_settings"])) {
- $wmt = esc_attr($_POST["wmt-code"]);
- $ga = $_POST["ga-code"];
- update_option("theme_wmt", $wmt);
- update_option("theme_ga", $ga);
- ?>
- <div id="message" class="updated">Settings saved</div>
- <?php
- }
- }
- function add_wmt() {
- ?>
- <meta name="google-site-verification" content="<?php echo get_option("theme_wmt");?>">
- <?php
- }
- function add_ga() {
- echo get_option("theme_ga");
- }
- add_action("wp_head", "add_wmt");
- add_action("wp_footer", "add_ga");
- add_action("admin_menu", "setup_theme_admin_menus");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement