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

236 Comments Add your own

Pages: [24] 23 22 21 20 19 18 17 16 15 141 »

  • 236. Clearskys.net Blog »&hellip  |  December 17th, 2008 at 3:30 am

    […] themes construct their menu’s in one of three ways - from WordPress page titles, using a custom-written administration panel or hard coding them into the themes […]

  • 235. Clearskys.net Blog »&hellip  |  December 11th, 2008 at 10:12 pm

    […] no idea, it took very little work). I’ve also integrated my heavily customised version of the Sticky Menus plugin to enable me to add “off-site” menu links without having to hack the […]

  • 234. Meyerbytes » 150 Bl&hellip  |  December 8th, 2008 at 3:08 am

    […] Sticky Menu […]

  • 233. sean  |  December 1st, 2008 at 11:27 pm

    Has anyone run into trouble even after modifying the php file as explained here? I still can’t get WordPress to create any menus. After I press ’save’ I just end up back on the same page.

  • 232. sean  |  December 1st, 2008 at 7:51 pm

    @Faramarz

    I think SJB meant to ask where he should place the code. I’m having a similar issue. No matter where I place it in the header.php file, it is simply displayed as text and the menus still don’t work.

  • 231. Faramarz  |  December 1st, 2008 at 6:26 am

    @SJB
    Where it says (’menu=Main’), change “Main” to whatever name you put for the new menu you created in wordpress back-end.
    Thanks for the great plugin, it would be perfect if you could also define the “current” status to the active menu item.

Pages: [24] 23 22 21 20 19 18 17 16 15 141 »

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