Custom menu style problem

Hi,

I am using a wordpress theme with a custom top navigation menu ‘wp_list_pages2()’. This custom naviagtion menu adds a ‘select’ class to the current menu item. Like below:

<div id=“menu”>
<ul>
<li>|</li><li><a class=“select” href=“http://www.ljwg.org.uk/”><span>Home</span></a></li><li>|</li><li><a href=“http://www.ljwg.org.uk/?page_id=18”><span>About us</span></a></li><li>|</li><li><a href=“http://www.ljwg.org.uk/?page_id=21”><span>Events</span></a></li><li>|</li><li><a href=“http://www.ljwg.org.uk/?page_id=26”><span>Media</span></a></li><li>|</li><li><a href=“http://www.ljwg.org.uk/?page_id=101”><span>Contact</span></a></li> </ul>

</div>

The problem is that this class is only added to menu links for static pages. When on the blog page (media) the class does not appear for the menu item.

<div id=“menu”>
<ul>
<li>|</li><li><a href=“http://www.ljwg.org.uk/”><span>Home</span></a></li><li>|</li><li><a href=“http://www.ljwg.org.uk/?page_id=18”><span>About us</span></a></li><li>|</li><li><a href=“http://www.ljwg.org.uk/?page_id=21”><span>Events</span></a></li><li>|</li><li><a href=“http://www.ljwg.org.uk/?page_id=26”><span>Media</span></a></li><li>|</li><li><a href=“http://www.ljwg.org.uk/?page_id=101”><span>Contact</span></a></li> </ul>

</div>

the php for this menu is as follows:

function wp_list_pages2() {

$defaults = array('depth' =&gt; 0, 'show_date' =&gt; '', 'date_format' =&gt; get_option('date_format'),
	'child_of' =&gt; 0, 'exclude' =&gt; '', 'title_li' =&gt;'', 'echo' =&gt; 1, 'authors' =&gt; '', 'sort_column' =&gt; 'menu_order, post_title');
$r = array_merge((array)$defaults, (array)$r);

$output = '';
$current_page = 0;

// sanitize, mostly to keep spaces out
$r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']);

// Allow plugins to filter an array of excluded pages
$r['exclude'] = implode(',', apply_filters('wp_list_pages_excludes', explode(',', $r['exclude'])));

// Query pages.
$pages = get_pages($r);

if ( !empty($pages) ) {

	for($i=0;$i&lt;count($pages);$i++)
	{
		$class='';
		if(is_page($pages[$i]-&gt;post_title))
			$class=' class="select" ';
		$output .='&lt;li&gt;|&lt;/li&gt;&lt;li&gt;&lt;a '.$class.' href="'.get_page_link($pages[$i]-&gt;ID).'"&gt;&lt;span&gt;'.$pages[$i]-&gt;post_title.'&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;';
		
	}
}

$output = apply_filters('wp_list_pages', $output);

echo $output;

}

I used simpe CSS to style the current page item:

#menu li a.select{
font-weight: bold;
}

Does anyone have any idea why this would be.

Cheers

Maybe because those pages are not quite pages, but category pages or archives?