Adding new menu within the single site - no sidebar e.g.
Hi there,
I tried to call a menu at the bottom of my page via (menu name=”IndividualMenuName”) (read [ instead of ( ), right above the footer. I didn't find a shortcode within the theme, so I added php code into the function php:
(please ignore the //, this is to get this php code posted here)
//function print_menu_shortcode($atts, $content = null) {
// extract(shortcode_atts(array( 'name' => null, ), $atts));
// return wp_nav_menu( array( 'menu' => $name, 'echo' => false ) );
//}
//add_shortcode('menu', 'print_menu_shortcode');
It woked how I wanted it, the website is fine, but now the dashboard is broken:
Warning: Cannot modify header information - headers already sent
by (output started at
/xxx/wp-content/themes/betheme/functions.php:130)
in /xxx/wp-includes/pluggable.php on line 1179
Even after i deleted the php lines in the functions.php (I got via "back" button into the editor, deleting php script and "saved" the modifications) this error still occurs. The php script is actually deleted, because the site does not show the menu anymore. The Dashboard is still broken. I fear that I need to upload the old functions.php to repair it, I think that will fix it (right now I got no upload possibility til tonight, but I need to work on at the website now...).
1) Why did this happen, why is it obviously not allowed to use the wordpress editor?
2) Is there a function within the theme to call an individual menu at any part of the single site? (not a sidebar or anything like that...) OR where do I have to put the php function in to get it work?
Thank you so much for your help!
I tried to call a menu at the bottom of my page via (menu name=”IndividualMenuName”) (read [ instead of ( ), right above the footer. I didn't find a shortcode within the theme, so I added php code into the function php:
(please ignore the //, this is to get this php code posted here)
//function print_menu_shortcode($atts, $content = null) {
// extract(shortcode_atts(array( 'name' => null, ), $atts));
// return wp_nav_menu( array( 'menu' => $name, 'echo' => false ) );
//}
//add_shortcode('menu', 'print_menu_shortcode');
It woked how I wanted it, the website is fine, but now the dashboard is broken:
Warning: Cannot modify header information - headers already sent
by (output started at
/xxx/wp-content/themes/betheme/functions.php:130)
in /xxx/wp-includes/pluggable.php on line 1179
Even after i deleted the php lines in the functions.php (I got via "back" button into the editor, deleting php script and "saved" the modifications) this error still occurs. The php script is actually deleted, because the site does not show the menu anymore. The Dashboard is still broken. I fear that I need to upload the old functions.php to repair it, I think that will fix it (right now I got no upload possibility til tonight, but I need to work on at the website now...).
1) Why did this happen, why is it obviously not allowed to use the wordpress editor?
2) Is there a function within the theme to call an individual menu at any part of the single site? (not a sidebar or anything like that...) OR where do I have to put the php function in to get it work?
Thank you so much for your help!
Comments
unfortunately we are not able to help in this case because you made changes in wordpress/theme files. All we can recommend in this case is wordpress and theme re-installation because we do not support modified wordpress installations.
Thanks for understanding!
I was glad if you would have a positive answer to my second question above:
2) Is there a function within the theme to call an individual menu at
any part of the single site? (not a sidebar or anything like that...)[...]