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

218 Comments Add your own

Pages: « 2219 18 17 16 15 [14] 13 12 11 10 91 »

  • 140. Ivan  |  May 9th, 2007 at 5:24 pm

    Hi sorry but i dont speack english weel. A question:

    http://www.freerun.ch

    The onli think i had putting this code:

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

    … is a goodlookink gray line under my titleblog.
    My menu name is “pannello”.

    Can u help me tela? i tryed 10 differents codes in many different page place!

    TY!

  • 139. Olivia  |  May 5th, 2007 at 4:15 am

    Can anyone explain how to link to an external website? It says that this plugin is capable of doing this. I put the external link in the text box that calls for it, but when the resulting link is clicked on, I get a 404 Not Found error. I would like the link to simply go to the external page, not try treat it like an element of the blog. I would apprecaite a tip or two on how to do this. Thank you.

  • 138. Flash Buddy  |  May 3rd, 2007 at 6:16 pm

    Great plugin! I’ve added it to my must have plugins for WordPress. See it at work:
    http://hqcode.com/

  • 137. tela  |  May 2nd, 2007 at 2:31 pm

    Hi Maurice,

    To make all these changes you have to modify various files (.php and .css) in the folder theme. Some other changes will require to install a plugin.

    If you have no programming background, all this might look like a real challenge for you. I think that it’s probably a good idea to ask somebody to do this job, through elance, why not. Or we can also do it.

    If you have a list ready with the changes you want to make, the job can probably be done in one day. If you are interested you can contact me by email.

    Just one quick answer for point 4: the “Most recent posts” section is programmed to display 5 posts and it doesn’t include the very last one. That’s why there is right now only one post. There is nothing to change. This will increment with the new posts you’ll add.

  • 136. Maurice  |  April 30th, 2007 at 4:24 am

    That worked! Wow - thanks very much.

    I’d like to make a few other changes to my theme, and was hoping you could tell me where I could find help. I would like to:

    (1) Increase the size of the font in posts
    (2) Remove the “Meta” section from the right column
    (3) Add to the right column (below “Most Recent Posts”) a category for “Most Popular Posts”
    (4) Change the “Most Recent Posts” category so it displays more than one post (it currently displays only one post)
    (5) Add pages for missing menu items (I have used the stickymenu plugin to make a top menu. In the menu I have added “Newsletter” and “FAQs”. How do I make pages for these?)
    (6) Make numerous formatting changes (for example, I’d like to reduce the amount of white space between the homepage header and top menu bar)

    Apologies for this long list! I have no programming background whatsoever - if you could advise me on how I can get these changes made, I would appreciate it. Should I use eLance?

  • 135. tela  |  April 28th, 2007 at 10:25 am

    Hi Maurice,
    It looks like there is an issue when the Wordpress install is in a subdirectory.

    The plugin is supposed to create a table wp_stickymenu when you activate the plugin as eric explained in comment #2

    In your case, it seems that you need to create this table manually. If you are a little bit confused by eric’s explanation, you can have a look at Lisa’s comment. That should help you.

  • 134. maurice  |  April 26th, 2007 at 5:22 pm

    Thanks for the advice - but I DID use version 1.1. And it still doesn’t work!

    Here are the steps I followed:

    (1) Dowloaded stickymenu-1.1.zip

    (2) Uploaded all of the contents of stickymenu-1.1.zip to this directory: /wp-content/plugins

    (3) Activated the plug-in

    (4) In Manage > Sticky menus, I tried to create a menu item for “top”, but got this message:

    WordPress database error: [Table ‘momsonli_wrdp2.wp_stickymenu’ doesn’t exist]
    SELECT DISTINCT menu FROM `wp_stickymenu`

    (5) When I checked the site, in the place where the top menu should be, there’s this message:

    WordPress database error: [Table ‘momsonli_wrdp2.wp_stickymenu’ doesn’t exist]
    SELECT * FROM `wp_stickymenu` WHERE `menu` = ‘top’ AND `disabled` 1 ORDER BY `weight` ASC

    The one step I did not follow from the readme.txt file is this step:

    In header.php (as an example), add somewhere where you want to display a menu:

    display_menu(’menu=main’); # To display menu ‘main’
    };

    I have no technical background, so I have no idea what this last step means.

    If someone could help me sort this out I’ll name my next child after you!

  • 133. tela  |  April 26th, 2007 at 9:41 am

    Hi Maurice,
    I think there is an issue with the latest version 1.2. See comment#104.

    That’s why eric recommends to use version stickymenu 1.1.

  • 132. maurice  |  April 25th, 2007 at 7:08 pm

    I’m getting the same error message as 128 (and others before). On the Manage / Sticky Menus screen I get this:

    WordPress database error: [Table ‘momsonli_wrdp2.wp_stickymenu’ doesn’t exist]
    SELECT DISTINCT menu FROM `wp_stickymenu`

    Coud somebody help? I’ve read all of the previous posts for clues and still can’t figure it out.

    Thanks very much

  • 131. tela  |  April 25th, 2007 at 1:59 pm

    Hi Darren,
    If you want your menu to appear only on one page, you can enclose the code for the sticky menu with a conditional tag.
    For example if the page you want the menu to display is the post with ID #17, you can use if is_single('17').
    You can find more info about conditional tags here: http://codex.wordpress.org/Conditional_Tags

Pages: « 2219 18 17 16 15 [14] 13 12 11 10 91 »

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