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: « 22 21 20 19 [18] 17 16 15 14 13 121 »

  • 180. Andy  |  July 23rd, 2007 at 11:41 pm

    Hi

    I think this plug in is awesome - but am finding a probelm when the site loads in IE - the menu goes all over the place and there seems to be a javascript error??? - any thoughts?

  • 179. tela  |  July 22nd, 2007 at 6:45 am

    Hi Bill,

    Please check comment #172 below. Thank you.

  • 178. Bill  |  July 21st, 2007 at 2:22 pm

    Just installed the plug-in and received an error. How can i fix it?

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

  • 177. Dennis Haller  |  July 19th, 2007 at 2:36 pm

    Great job at this solid plugin. Always nice to find something that matches your need.

    Running: WP 2.2.1 + stickymenu 1.4

    I have 1 note for ppl who may run into the error:
    Call to undefined function get_currentuserinfo()

    The problem comes with the plugin gengo and maybe others. The writer of this plugin mentioned that the call for load_plugin_textdomain is to soon and must be moved to the function which is used for the init hook.

    So move the function load_plugin_textdomain(’stickymenu’, ‘wp-content/plugins/stickymenu’); at line 38 to the function function stickymenu_install() . Thats it.

    Ps. if you want the post I got this from go to: http://wp-multilingual.net/2007/03/17/gengo-09/en/

    Thx again for the awsome plugin!!!

  • 176. Martin  |  July 7th, 2007 at 6:35 am

    Just like mumin, 1.4 didn’t solve my problem.

    I created the table manually (with the prefix I use) and now everything works fine.

    Thanks you for this nive plugin!

  • 175. mumin  |  July 6th, 2007 at 10:18 am

    Ver 1.4 still not solves my problem :

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

  • 174. ericdes  |  July 6th, 2007 at 8:27 am

    Please try version 1.4 if it solves your problem.

  • 173. mumin  |  July 6th, 2007 at 5:09 am

    Hi, I got the same problem here but having problem when try running your sql code.

    Error
    SQL query:

    CREATE TABLE `wp_stickymenu` (

    `id` int( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
    `name` VARCHAR( 55 ) NOT NULL ,
    `link` VARCHAR( 255 ) NOT NULL ,
    `menu` VARCHAR( 55 ) NOT NULL ,
    `weight` int( 11 ) NOT NULL DEFAULT‘0′,
    `disabled` TINYINT NOT NULL DEFAULT‘0′,
    PRIMARY KEY ( `id` )
    ) TYPE = MYISAM ;

    MySQL said:

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘‘0′,
    `disabled` TINYINT NOT NULL DEFAULT ‘0′,
    PRIMARY KEY (`id`)
    ) TY’ at line 6

    I use godaddy hosting and 0 knowladge in sql.. please help

  • 172. tela  |  July 5th, 2007 at 6:54 pm

    Hi Byron,

    Yes, this is indeed the problem. You need to manually create the table. Lisa (comment #97) previously provided some explanation to do this:

    You need to go to your control panel (accessed through your web host), look for a tab called “phpMyAdmin” - mine was under the “Databases” category.
    Click “phpMyAdmin” link
    Click “databases” link
    Click SQL tab
    Should open up a box “Run SQL query/queries on server localhost: Documentation”
    Paste the code below into the box:

    CREATE TABLE `wp_stickymenu` (
    
    `id` int( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT ,
    `name` VARCHAR( 55 ) NOT NULL ,
    `link` VARCHAR( 255 ) NOT NULL ,
    `menu` VARCHAR( 55 ) NOT NULL ,
    `class` VARCHAR( 55 ) NOT NULL ,
    `weight` int( 11 ) NOT NULL DEFAULT 0,
    `disabled` TINYINT NOT NULL DEFAULT 0,
    PRIMARY KEY ( `id` )
    ) TYPE = MYISAM ;

    Click “go” and you should be good to go from here - at least I was, I’m using BlueHost so can’t say if it’s exactly the same for other hosts.

    (Edited on 7/7/07 to adjust to the new version of Sticky Menu)

  • 171. Byron  |  July 5th, 2007 at 6:17 pm

    Seems like I do not have the tables that I need, could you show me how to possibly add them? What else could I try?

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