Noscope is a bi-weekly journal serving up snacksized portions of pointless stuff since 2001.
I also do freelance design and usability via dejligt.com

Sliding Doors In Wordpress

    11:34 on January 14th, 2010 ,

A default Wordpress page menu is built like this:

<?php
wp_page_menu(array('depth'=>'0', 'sort_column'=>'menu_order')); 
?>

– which outputs a plain menu, <li><a href=" ... ">Menu Item</a></li> and so on.

If you want to use the sliding doors CSS technique, however, you need more markup. So do this:

<?php
echo preg_replace('@\<li([^>]*)>\<a([^>]*)>(.*?)\<\/a>@i', '<li$1><a$2><span>$3</span></a>', wp_page_menu(array('echo'=>false,'depth'=>'0', 'sort_column'=>'menu_order')) );
?>

– which’ll output this a more CSS friendly markup: <li><a href=" ... "><span>Menu Item</span></a></li>.