Firstly, you should absolutely not modify core files. Ever. Any changes you make to core files can and will be overwritten any time WordPress updates. There are umpteen ways in which WP has been written to allow you to change its behaviour without hacking on core files: hooks, filters, APIs. Use those instead.
In this case you should be writing a plugin, because you’re changing functionality. That’s in a plugin’s wheelhouse, a theme should only be concerned with displaying the frontend of the site.
You can add to the sidebar with add_menu_page()
and add_submenu_page()
, both of which are well documented in the developer docs I linked.
Related Posts:
- Can’t extend some core classes
- Remove metabox from WordPress menu editor page?
- Redirect to another page using contact form 7? [closed]
- How can I update WordPress plugins or WordPress itself in all server?
- How to disable sub menu items from being created?
- WP Admin Bar – Get current theme name as custom menu title
- Running WP Cron on multisite the right way
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- Integrating WordPress to my website, while keeping my own authentication system
- Multisite get_home_url(); – Getting URL for current site
- How to use wp_insert_user on WordPress Multisite?
- How to show only parents subpages of current page item in vertical menu?
- Sort posts from multiple sites by date
- removing tags from wp_list_pages() using PHP
- How can I add a class to a single menu item?
- Remove all nav menu classes ( but keep useful ones… )
- How to display conditional-content if wp_nav_menu( $args ) retruns something
- How to add values to media “whitelist_options” in wp-admin/options.php template?
- Multiple WordPress Menus that will only display all pages
- Menu — How to add “current-menu-grand-ancestor” css class
- Hide Hamburger Menu On Specific Page (Front Page/Home Page)
- Menu Limitations
- Namespace spl_autoload problem in WordPress admin
- Automatically adding new post categories to menu
- Cannot access wp-admin (wordpress dashboard)
- How to make my custom widget appear within WordPress widgets? Plugin development
- WordPress admin is incredibly slow [closed]
- Custom Menus: dynamic highlighting problem with custom home link
- Is it best to avoid using $wpdb for security issues?
- Register a menu – Error Header
- How to style one item from main navigation?
- How to avoid duplicates when creating recent network posts
- Usage of call back function of add_meta_box()
- Add value to new attribute inside WordPress menu items
- Menu Items fail to save correctly, cause reset of related page metadata
- Dropdown menu for categories
- Get the name of menu item with wp_nav_menu
- WordPress homepage setup not working on first load
- Output only links using wp_nav_menu()
- How to add aria role and schema markup to custom walker container
- Nav menu from plugin to theme
- I installed WordPress locally now how do I login?
- Extend Menu Walker Output
- 2 wordpress site same database
- How to debug failed changes to posts?
- how to add a div inside wp_page_menu
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- Remove submenu item from list
- conditional: if is page, and all subpages
- wp nav menu: show submenu below li item
- need help adding a new sidebar to a page that can’t use page-templates -> multisite
- How can I fix this code [duplicate]
- Remove the Tag from wp_nav_menu
- Styling an “active” link outside of WordPress default menu
- Dynamic menu with custom post types
- bp-custom.php is not working on a WordPress multisite environment. how to fix it?
- Fatal error login WordPress [duplicate]
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- Replace jQuery with PHP or CSS for Customized WordPress wp_nav_menu
- Class ‘WP_Privacy_Requests_Table’ not found
- Internal Server Errors – Moving working multi-site install to my localhost
- Redirect User when they click Menu Option
- How to separate the taxonomies list from the form so that editing taxonmies is the same as pages and posts?
- Access to “My Site” is missing from the admin bar
- Redirect user role to a specific page on login in a multisite network?
- spl_autoload_register is slow for WordPress sites
- Difference between “Walker_Nav_menu” and “walker”
- Remove node from multisites?
- Add .php to end of all WordPress Pages (multisite)
- Vertical Menu for one page only
- List all blogs apart from the current blog and main blog in WordPress Multisite
- PHP drop down menu for my get_category child of
- Adding users to another blog
- Pulling a variable into the wp_nav_menu function
- Beyond widget side menu editing, with the php page, custom template
- wp nav menu without label
- Active class not working on custom menu link using add_menu_page
- Styling admin page rows in order of importance (checkboxes)
- Sidebar current menu item for parent
- Remove all nav menu classes except those which begin with certain letters
- How to add a code for lastpostdate after/inside a specific menu link?
- Add the “.current-menu-item” class to tag?
- WordPress adding in site URL to header links
- Can’t remove menu items added by plugin
- Adding a unique class to wp_nav_menu
- .htaccess on multisite and roots theme?
- Open WordPress Page from selected option dropdown
- Remove Unused Menu Locations
- How do I change the Go To Categories link in the term_updated_messages
- How to add different menu items on different menus?
- Can I associate a custom post type with another custom post type?
- How to use multiple custom post types to archive as front page?
- Nav menù doesn’t display selected pages
- Custom post type removing /page/2/ from URL when trying to access it
- WordPress CPT & Custom Taxonomy with the SAME Permalink Structure
- Hot to show custom post type taxonomies on archive page
- child category under correct parent
- Send summary email from a form with wp_mail
- Can’t assign menu parent id or menu item breaks