Sticky Menu, a plugin for WordPress

July 6th, 2007 ericdes

I wrote this little plugin to easily create menus in WordPress.

Normal use of WordPress to create menus:

Because WordPress normally creates menus automatically, for example from a list of categories or pages, you have to exclude manually all items you don’t want in your menu, which can be a lengthy process if you have a lot of categories or pages.

Also, you can’t mix categories and pages in a same menu. You can’t put a link to a subdomain, which could be the case if you have a forum running outside WordPress for example.

What Sticky Menu improves:

Sticky Menu lets you define an unlimited number of menus, in which

you list the exact number of menu items you want to appear. Menu items can link to any pages, posts, etc., in your site or any URLs exterior to your site. You can define a class name for each menu item.

With Sticky Menu being activated, you go to the admin board and look for Sticky Menu in the ‘Manage’ section. There, you create as many menus and menu items as you’d like. In this example, I created a menu named ‘Main’ with 4 menu items: Home, Fun, About me, Contact me.

Sticky Menu's screenshot - Click to enlarge
Then I edited the template files header.php, footer.php, sidebar.php to add these lines:

$menu = new stickymenu;
$menu->display_menu('menu=Main'); # Will display menu 'Main' here

Sticky Menu - See the result!

(Please note that the names are case-sensitive, e.g. ‘Main’ is different than ‘main’.)


5/21/2008: Sticky Menu 1.41 - Fixed type bug related to ‘class’ field.

Download links to the Sticky Menu plugin:

Sticky Menu 1.41 (tar.gz)

Sticky Menu 1.41 (.zip)


Sticky Menu Download Area (History)

Entry Filed under: WordPress plugins

230 Comments Add your own

Pages: « 2313 12 11 10 9 [8] 7 6 5 4 31 »

  • 80. Tela-Web » How to c&hellip  |  October 29th, 2006 at 7:04 pm

    […] The same question showed up several times in the comments for the Sticky Menu plugin for Wordpress so I decided to write a post specifically for that. […]

  • 79. Sara  |  October 26th, 2006 at 5:54 pm

    Tela - Thank you for your response. Now I can display the menu horizontally but it shows up in the middle to the header. I try playing around with some of the margins but not able to push it down to the bottom of the header.

    Any thing else I need to add or modify?

    Sara

  • 78. tela  |  October 23rd, 2006 at 9:43 am

    Hello Sara,
    Please look at comment #59 where I explain how to display the menu horizontally.

  • 77. Sara  |  October 22nd, 2006 at 3:31 pm

    Hi - I am trying to use Sticky Menu and running in to some issues. It is showing up on my header bar but it is not showing up horizontally (showing up vertical as bullet points).

    I would like for it show up as horizontal tabs.

    Any input?

  • 76. peter  |  October 18th, 2006 at 9:44 pm

    Thank you for your quick response. Your solution had the same outcome as mine: the headerimage descended for about 40px. You can see the result here:

    http://www.legerhumor.nl/jpg/screenshot.jpg

    So, and only if you got some time to spare, I hope you can help me find another solution. Thnx for your time anyway!

  • 75. tela  |  October 17th, 2006 at 3:49 pm

    Peter,
    Here is a solution I found:
    You put the code for the sticky menu in header.php after <div id="header"></div> (not inside).

    You wrap the code like I advised to somebody else before:

    <div id="navcontainer">
    <ul id="navlist">
    <?php $menu = new stickymenu; ?>
    <?php $menu->display_menu('menu=Main'); ?>
    </ul>
    </div>

    Then you need to add the css code to style your menu. You can use the one I gave above, see comments #59.

    If you want your menu to be over the image, you can add a negative margin-top to #navcontainer and some margin-left to align the menu under your text:

    div#navcontainer {
    margin-top:-15px;
    margin-left: 120px;
    }

  • 74. peter  |  October 17th, 2006 at 2:05 pm

    I like to have the menu at the left bottom of the headerimage, just below the text: “het leger van z’n leukste kant”. I’ve seen it done on other websites so it must be possible. Hope to hear from you soon. You can email me directly if you want.

  • 73. tela  |  October 17th, 2006 at 9:25 am

    Dean,
    Looks like you didn’t put the tags <?php ... ?>

    <?php $menu = new stickymenu; ?>
    <?php $menu->display_menu('menu=October Events'); 
    # Will display menu 'October Events' ?>

  • 72. Dean  |  October 17th, 2006 at 8:27 am

    Eric- Apparently, I must be doing something wrong with this plugin. I inserted the code into the sidebar but nothing happens. Here is the site, http://www.caaan.org . You should see the error on the sidebar. Thoughts? Thanks for your time.

  • 71. tela  |  October 16th, 2006 at 9:21 pm

    Peter,
    I can not help you unless I see your page. Give me the address of your website and I’ll have a look at it if you want.

Pages: « 2313 12 11 10 9 [8] 7 6 5 4 31 »

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed