First page of the widget archive.

WordPress 3.0 Navigation Menu Styles

Posted by The Doctor on Mar 17, 2010 with No Comments | Short Link
Last modified by The Doctor on April 15, 2010
in Functions, Tips
as , , , , ,

Let’s jump right in …

Using the default definition from the register_sidebar() function found in ../wp-includes/widgets.php of WordPress version 3.0-alpha 3.0-beta12 (see below):

	$defaults = array(
		'name' => sprintf(__('Sidebar %d'), $i ),
		'id' => "sidebar-$i",
		'description' => '',
		'before_widget' => '<li id="%1$s" class="widget %2$s">',
		'after_widget' => "</li>\n",
		'before_title' => '<h2 class="widgettitle">',
		'after_title' => "</h2>\n",
	);

… and the default Navigation Menu widget, the following CSS style elements are generated:

  • #nav-menu-<widget instance>
  • .widget
  • .widget_nav_menu
  • .widgettitle

… with these elements generated specifically by the wp_nav_menu() function found in ../wp-includes/default-widgets.php of WordPress version 3.0-alpha 3.0-beta12:

  • .menu-<menu name>-container2
  • #menu-<menu name>
  • .menu
  • #menu-item-<unique identifier*>
  • .menu-item-type-<types: page, category, Custom>1
  • .menu-item2
  • .menu-item-type-<post_type, custom, or taxonomy>2
  • .menu-item-object-<page, or category>2
  • .current_page_item
  • .sub-menu1

This is just an initial listing of my observations as of the March 16, 2010 3.0-alpha version of WordPress. Look for future updates; and, please feel free to make note of your own observations below.

Bonus – A suggested addition to style.css for theme developers:

/* WordPress 3.0 Navigation Menu default widget */
.widget_nav_menu .menu {margin: 0;}
.widget_nav_menu .menu li {
  display: block;
  float: none;
  /* text-align: left; */
}
*N.B. – each new menu item generates its own post ID in the WordPress database ‘posts’ table. This appears to be in a similar fashion to post revisions.
    Notes:

  1. Mar 21, 2010
    • menu item type class further defined
    • sub-menu class noted
  2. Apr 15, 2010 (3.0-beta1 updates)
    • additional menu classes defined and/or modified
    • new menu container class noted

Calendar Default Widget Broken

Posted by The Doctor on Jan 22, 2010 with No Comments | Short Link
Last modified by The Doctor on March 17, 2010
in News
as , , ,

I just happened to notice this today. The calendar default widget that comes with WordPress is having issues. It appears to work fine on the initial visit to a blog’s home page, but if you start reading the archives, especially using the calendar as a navigation tool you may find the calendar using some very oddly structured months.

Here is the trac ticket: http://core.trac.wordpress.org/ticket/11414, so it is being addressed.

In the meantime, I have decided to install the Ajax Calendar plugin as a substitute. There are many other calendar plugins available but this one suits my current needs.