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

215 Comments Add your own

Pages: [22] 21 20 19 18 17 16 15 14 13 121 »

  • 215. Allan N  |  June 28th, 2008 at 5:46 pm

    Hi, great plugin but I am having one issue when doing a vertical list on firefox the bullet point is out of the box, looks fine in IE 7. Any ideas?

  • 214. Daniel  |  June 27th, 2008 at 6:24 am

    Can this plugin control a dropdown menu?

    Thanks!

  • 213. Chris  |  June 24th, 2008 at 5:19 pm

    Hmm… it seems the code was stripped out of my previous comment. In any case, if you want those classes to come over during edits modify line 166 by echoing a value tag with $classes[$i].

  • 212. Chris  |  June 24th, 2008 at 5:13 pm

    One other thing I noticed in version 1.4 (haven’t downloaded 1.41 so not sure if this is in there):

    When you edit a link that has a class specified the class does not display on the edit link page. To reproduce:

    1. Create a link and specify a class name
    2. Save the link
    3. ‘Edit’ the link
    4. The class name does not display

    This is fine if you’re editing a single link, and know what the class was, but it can be a pain if your batch editing like 10+ links.

    Update line 166 in admin.php from:

    To:
    <input type=”text” name=”class[]” maxlength=”55″ style=”width:140px;” value=”">

  • 211. Juan  |  June 13th, 2008 at 11:15 am

    I updated to wp 2.5. Now the sticky menu in the admin pages is gone! Although sticky menu still works. Also I get the error “Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ’stickymenupagebar::adminpage’ was given in /var/home/blablabla/www/wp-includes/plugin.php on line 311″ on top of every admin-page.

    I already deactivated, activated, uploaded new and so on …

    Please HELP.

    Thanks!

Pages: [22] 21 20 19 18 17 16 15 14 13 121 »

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