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 »

  • 50. ericdes  |  August 6th, 2006 at 8:01 pm

    Brian, your code shows:

    <?php echo $menu = new stickymenu; ?>
    <?php echo $menu->display_menu('menu=Main'); ?>

    Remove the ‘echo’ to just leave ‘$menu = new stickymenu;’

  • 49. Brian  |  August 6th, 2006 at 3:22 am

    I also have the “Object” text appearing before my menu, can’t figure out where that is coming from?

  • 48. ericdes  |  August 5th, 2006 at 10:28 am

    billhector,

    I’m working on stickymenu 1.2 and thinking of adding:
    $output .= preg_replace('/\s+/', '', $item['name']).'">;

    Would it fix your problem with spaces in CSS names? I bet the spaces are not the only caracters to remove to have valid CSS names…

  • 47. Blog » Blog Archive&hellip  |  August 3rd, 2006 at 7:37 pm

    […] http://tela-web.com/wordpress-plugins/sticky-menu/trackback/ […]

  • 46. tela  |  July 26th, 2006 at 12:02 pm

    Sam: if you want to remove the section “Posts by category”, you need to check the file sidebar.php, find the template tag : wp_list_cats (it might be repeated several times in sidebar.php). Then delete the section that calls it. Depending on your theme, it might different. For this site, it is:

    
    <li class="categories">
    <h2>Categories</h2>
    <ul>
    <?php wp_list_cats('sort_column=name&hide_empty=1'); ?> 
    </ul>
    </li>

  • 45. Sam  |  July 25th, 2006 at 11:14 pm

    How do i get the other categories that wp displays to go away such as the “posts by category” and it’s links that are on this site. Where do i go to delete that so i only see my sticky menu object.

  • 44. Ryan  |  July 25th, 2006 at 6:55 pm

    Anyone actually checked these comments?

  • 43. Ryan  |  July 18th, 2006 at 11:00 pm

    Go the plugin working, but when I put the code into my site to display the menu….well instead of a heading that says Main or Menu…it says Object and then lists the links below that.

    Can’t figure out where it’s pulling that name from but I’d like to change it.

    Thanks

  • 42. Bryan  |  July 15th, 2006 at 7:11 am

    Is there any way to create a menu item that pulls in the search box?

    My current search box is pulled into a sidebar widget with the following: <?php include (TEMPLATEPATH . '/searchform.php'); ?>

    Is there a way to make the results of this include show up as a menu item?

    I like your sticky menu very much otherwise. I also like the idea of potentially adding “child” menus.

  • 41. Bryan  |  July 15th, 2006 at 7:09 am

    Is there any way to create a menu item that pulls in the search box?

    My current search box is pulled into a sidebar widget with the following:

    Is there a way to make the results of this include show up as a menu item?

    I like your sticky menu very much otherwise. I also like the idea of potentially adding “child” menus.

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