I want to add nofollow rel to tag cloud on single post only. This function code in functions.php works fine but I couldn’t figure it out how to restrict it to single.php only.
function szub_nofollow_tag($text) {
return str_replace('<a href=', '<a rel="nofollow" href=', $text);
}
add_filter('wp_tag_cloud', 'szub_nofollow_tag');
Could you please tell me how to do it??
http://codex.wordpress.org/Function_Reference/is_singular
Should do the trick, remember to use it inside the function itself as I don’t think WordPress knows if it’s true/false while parsing functions.php