WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] register_my_menus warning (11 posts)

  1. 1timothy412
    Member
    Posted 1 year ago #

    I just transferred a WP site that I am building to the localhost of my new computer. Everything was working fine on my old computer, but now I am receiving this warning message:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'register_my_menus' not found or invalid function name in C:\xampp\htdocs\j--------i\wordpress\wp-includes\plugin.php on line 406

    Here's line 406 from plugin.php:
    call_user_func_array($the_['function'], array_slice($args, 0, (int) $the_['accepted_args']));

    Also, further down the page, I see this warning:
    Warning: Missing argument 1 for ResponsiveColumnWidgets(), called in C:\xampp\htdocs\j--------i\wordpress\wp-content\themes\blankslate\footer.php on line 5 and defined in C:\xampp\htdocs\j--------i\wordpress\wp-content\plugins\responsive-column-widgets\responsive-column-widgets.php on line 137

    Here's footer.php line 5:
    <div id="footer-widgets"><?php ResponsiveColumnWidgets(); ?></div>

    And here's resonsive-column-widgets.php line 137:
    function ResponsiveColumnWidgets( $arrParams ) {

    I know very little of PHP so I would really appreciate help. Thanks.

  2. esmi
    Forum Moderator
    Posted 1 year ago #

    You have an issue in your theme. Where did you download it from?

  3. 1timothy412
    Member
    Posted 1 year ago #

    I downloaded it from the WP directory. It is the theme "Blankslate."

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    Re-upload a fresh, unpacked, copy of the theme's folder to wp-content/themes using FTP or whatever file management application your host provides.
    http://wordpress.org/extend/themes/blankslate

  5. TidyThemes
    Member
    Posted 1 year ago #

    Most of these errors pertain to Responsive actually, not BlankSlate.

    Not sure how you're getting mixed theme errors? Are you using some sort of error checking plugin or otherwise mixing and matching the themes?

    You're definitely doing something unique and custom here which would be good for us to know the specifics on.

    Thanks

  6. 1timothy412
    Member
    Posted 1 year ago #

    I am using BlankSlate as the theme, and am using a plugin called Responsive Column Widgets (from the WP directory) in the footer. Also, I added more menus to the theme myself (but that was working just fine before today).

    I did upgrade the Responsive Column Widgets plugin just the other day, but when I deactivated it to see if it was causing the problem, both of the warnings persisted.

    Here's the code from the functions.php file about the menus:

    if ( ! isset( $content_width ) ) $content_width = 640;
    register_nav_menus(
    array( 'main-menu' => __( 'Main Menu', 'blankslate' ),
           'extra-menu' => __( 'Extra Menu' ),
           'extra-menu2' => __( 'Extra Menu 2' ),
        )
      );
    }
    add_action( 'init', 'register_my_menus' );

    This is only the second time that I've added menus to a theme, and as I said before, I am not super familiar with PHP. So I'm not sure how to figure out what's causing the problem.

  7. esmi
    Forum Moderator
    Posted 1 year ago #

    Can you replicate the problem using the default 2012 theme with all plugins deactivated?

  8. paulwpxp
    Font hero
    Posted 1 year ago #

    function 'register_my_menus' not found or invalid function name

    So that's a typo there, right? 'register_my_menus'

    This

    add_action( 'init', 'register_my_menus' );

    should be that there is actually a function name 'register_my_menus'

  9. TidyThemes
    Member
    Posted 1 year ago #

    In that case, we offer a starter theme built on the same code as BlankSlate, but with examples of multiple menus, widget areas and a good starter grid to help you get a kick-start on learning:

    http://tidythemes.com/supersimple/

  10. 1timothy412
    Member
    Posted 1 year ago #

    Hi everyone, thanks for your help. I ended up replacing my my functions.php file with the original code from BlankSlate. Then I added my menu function according to the codex: http://codex.wordpress.org/Navigation_Menus. It appears to be working fine now (no warning anymore), and so I'm thinking that I did something wrong the first time I added the menus.

    However, I'm still having a problem with the warning regarding the plugin Responsive Column Widgets. With all the troubleshooting I did I believe its unrelated to the first problem, so I think I'll post about it on the plugin support forum.

    Again, thanks so much for your questions and suggestions that helped me figure out what was going on.

  11. TidyThemes
    Member
    Posted 1 year ago #

    You're welcome. Good luck with the project.

Topic Closed

This topic has been closed to new replies.

About this Topic