$related = wp_get_related_posts();
$find = '/<h3>(.*)<\/h3>(.*)/i';
$replace = '<h4 class="highlighted">$1</h4>$2';
echo preg_replace($find, $replace, $related);
The related posts plugin of wordpress generates nice additional information for a post. But to customize the generated HTML code you have to change the plugin code. Another solution is using a regular expression. Following this approach it is very easy to customize the header generated by the plugin. Here is the according PHP code snippet.$related = wp_get_related_posts();
$find = '/<h3>(.*)<\/h3>(.*)/i';
$replace = '<h4 class="highlighted">$1</h4>$2';
echo preg_replace($find, $replace, $related);
It simply extract the header text and wrap it into other HTML tags.