A function that adds custom menu option is preventing
-
Hello, I’ve been following a guide on how to make a blog from scratch. I copied a custom menu code into my functions.php that actually borked my plugin search function and media uploader.
I am running a localhost with AMPPS
If the code appear within my functions.php, then I can’t search for a plugin. It will keep on loading indefinitely. I also can’t delete an existing plugin while this error shows up
Deletion failed: <!– Adding Custom Menu option –> Return to InpharmD Blog Exploring Evidence {“success”:true,”data”:{“delete”:”plugin”,”slug”:”robo-gallery”,”plugin”:”robo-gallery\/robogallery.php”,”pluginName”:”Robo Gallery”}}
My media gallery will also not load the images it has. If I try to load a new image, this error message appears:
An error occurred in the upload. Please try again later.
Here is the code:
<!-- Adding Custom Menu option --> <?php function wpb_custom_new_menu() { register_nav_menu('my-custom-menu',__( 'My Custom Menu' )); } add_action( 'init', 'wpb_custom_new_menu' ); ?> <?php wp_nav_menu( array( 'theme_location' => 'my-custom-menu', 'container_class' => 'custom-menu-class' ) ); ?>
Is there something wrong with the code? I want to try and customize my own menu using code and without a plugin if possible. Thanks!
- The topic ‘A function that adds custom menu option is preventing’ is closed to new replies.