Hi GraphicLingoes,
Try this:
<?php foreach ($categoryRecords as $record): ?>
<?php
$html = $record['_listItemStart'];
if ($record['_isSelected']) {
$html = preg_replace('/<li>/', '<li class="selected">', $html);
}
echo $html;
?>
<a href="<?php echo $record['_link'] ?>"><?php echo $record['name'] ?></a>
<?php echo $record['_listItemEnd'] ?>
<?php endforeach ?>
You may need to change the code in red to match your own configuration.
I hope this helps! Please let me know if you have any questions.
All the best,
Chris