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: « 2311 10 9 8 7 6 5 4 [3] 2 1 »

  • 30. Vivre du Web » Util&hellip  |  June 20th, 2006 at 4:36 pm

    […] Pour l’essentiel, nous avons résolu le problème en développant un plugin, Sticky Menu. Il a un fonctionnement très basique, puisqu’il permet tout simplement de définir les différents titres que l’on veut mettre dans le menu, et pour chaque titre, le lien vers lequel il doit pointer. […]

  • 29. tela  |  June 20th, 2006 at 4:17 pm

    Hello Claudia,

    Once you have the vertical list, you need to style it with css to get a horizontal menu with rectangle boxes.

    So you’ll need to add new rules in your file style.css

    I’ll suggest you visit this website : http://css.maxdesign.com.au/listamatic/

    You’ll find all kinds of different code examples to style your menu as a horizontal navigation.

  • 28. Claudia  |  June 20th, 2006 at 12:57 am

    Hello,

    thank you for your plugin. I would like to add a horizontal menu beneath my header image, with rectangle boxes like in your second screenshot above. How do I go about it?

    If I add the suggested code in my header.php (the theme I use is wpde), I just get an unordered vertical list without boxes.

    Would be glad about some help because I’m not the most wizardly webdesign wiz ;-).

    Thanks,
    Claudia

  • 27. copy*free » making &hellip  |  June 12th, 2006 at 4:17 am

    […] Sticky Menu (permite gerir menus para utilizar em qq lado dos templates) […]

  • 26. Weye.org&hellip  |  May 25th, 2006 at 5:33 pm

    Sticky Menu Hack in WordPress…

    I am using the WordPress plugin Sticky Menu for this site and another project I am working on. It’s a very helpful plugin, filling a need that I’ve had for some time. However, I also have the need to do some advanced css, such as wanting …

  • 25. ericdes  |  May 25th, 2006 at 4:34 pm

    Hi Bill, I’m sure many users will find your contribution very useful. I’ll add it in the next release. Thanks!

  • 24. billhector  |  May 25th, 2006 at 4:16 pm

    I just wanted drop a little sticky menu hack on you, and maybe suggest adding it to the next version. This is a nice plugin, but it doesn’t account for people who like doing advanced css. I needed to add id tags to each menu item so that when combined with my dynamic body id tag (http://wordpress.org/support/topic/38264), allows me to change page styles according to the current page parent.

    Here is the small change I made in the plugin:

    $output .= '<li class="'.$item['name'].'Menu"><a href="'.$item['link'].'" title="'.$item['name'].'">'.$item['name'].'</a></li>'."\n";

    Hope someone finds this useful.

    Bill

  • 23. EncGuano  |  May 24th, 2006 at 5:13 pm

    Glad I could help!

  • 22. ericdes  |  May 24th, 2006 at 1:17 pm

    EncGuano, thank you for pointing that mistake to me. It’s now corrected. Thanks!

  • 21. EncGuano  |  May 24th, 2006 at 12:51 pm

    Probably it´s because of the install script in stickymenu.php…?

    In line 100 it says
    >> .” TINYINT NOT NULL DEFAULT ‘0′,”

    Probably it should be
    >> .” `disabled` TINYINT NOT NULL DEFAULT ‘0′,

    Well, I inserted the table (like described in comment 7) manually and noe it works like a charm!

    Thanks!!!

    Greets,
    EncGuano

Pages: « 2311 10 9 8 7 6 5 4 [3] 2 1 »

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