Displaying custom menus using widgets

I am using Wordpress Web Design for Dummies by Lisa Sabin-Wilson pages 228-229 to learn how to display custom menus using widgets for my website at http://www.grantlessons.org. I added the following code to the theme's function on Theme Twenty Thirteen hosted on Hosgator
// ADD MENU WIDGET
if ( function_exists('register_sidebars') )
register_sidebar(array('name'=>'Menu',));
?>
Then I went to the Dashboard for http://www.grantlessons.org and went to edit themes page and add the following code

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Menu') ) :
    ?>
    <?php endif; ?>

The problem is the Menu Widget Area is not displaying. Any ideas of what I am doing wrong. Your assistance is appreciated. Sandie

  • Patrick

    Hi @SandieBarrie

    Welcome to the forums!

    Did you know that WordPress comes pre-equipped with a custom menu widget that you can drag to any sidebar you want?

    The code you are trying to replicate does not create a new widget. It creates a new sidebar where widgets can be added.

    But there appear to be 2 errors in the register_sidebars function you pasted above:

    1. You're missing the opening php tag
    2. The comma after 'Menu' is likely mucking up the works.

    Try this instead:

    <?php
    if ( function_exists('register_sidebars') )
    register_sidebar(array('name'=>'Menu'));
    ?>

  • Patrick

    Hi again @SandieBarrie

    The beauty of WordPress is that you don't need to learn to be a programmer to work with it. There are so many different ways to get things done without any coding at all, it's simply marvelous.

    So anytime you want to customize or tweak things a little bit on your site, please drop in here and post again, or start a new topic.

    We're more than happy to help you get things running smoothly the way you want them. And we'll try really hard to keep code out of it for ya!

    :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.