Creating a Documentation Page in WordPress Admin

Creating a new page in the WordPress admin is easy! Use the “add_menu_page” function in wordpress to achieve your dreams.

Below is an example of adding a page for documentation to theWordPress admin. Place this in your theme functions.php or in a sub functions file that is included in functions.php.

For more in depth documentation, hit up add_menu_page docs in the WordPress Codex.

<?php 
function theme_docs_panel_admin(){
     if (function_exists('add_submenu_page')) {
          add_menu_page('Theme Documentation', 'Theme Documentation', 'publish_posts', "theme_docs", 'theme_docs_panel', 'none');
     }
}
add_action('admin_menu', 'theme_docs_panel_admin');
function theme_docs_panel() { ?> 
     <div class="wrap wp-core-ui">
          <h2>Theme Documentation</h2>
 
          <h3>Documentation PDF</h3>
          <p><a class="button button-primary" href="<?php echo gsdu(); ?>/support/admin-guide.pdf">Download</a></p>
          <p>&nbsp;</p>
          <h3>Theme Style Guidelines</h3>
          <p>Coming soon.</p>
          <p><img src="http://media.giphy.com/media/OCu7zWojqFA1W/giphy.gif" alt="" /></p>
 
     </div><!-- .wrap -->
 
<?php } ?>