How to modify wp-includes without messing my wordpress installation?

I’m using a Twenty Twelve theme with a child theme. When the screen is shrunk to less than a certain width a responsive menu is toggled. The problem is that this menu’s top level pages look the same as nested ones so I want to modify the menu’s template.

I thought this would be a matter of copying the menu’s template to my child-theme but the template file is located in wp-includes (it’s nav-menu-template.php I belive). How should I modify it so my changes are not erased when I update wordpress? And also with minimum risk of breaking something

Related posts

1 comment

  1. You won’t want to modify any files outside of wp-content unless you’re alright with them being blown away during an upgrade.

    The best way to modify what you’re talking about is in the styles.css file located in the wp-content/themes/twentytwelve folder. This way you just override the specific styles you’re not happy with and don’t need to worry about upgrades breaking your code. If you want to get a little more advanced, you can start modifying the functions.php and header.php files which house most of the functionality you’d need to modify.

    The nav-menu-template.php file you’re referring to in wp-includes is just a file that processes in the background and outputs data, the actual visual display is probably in header.php and pulls it’s design from styles.css.

Comments are closed.