Php string not working in WordPress Functions.php [duplicate]

You can use below code to append the string:

<?php
$category = get_the_category();
$related_blog .= '<div><a  href="'. get_category_link($category[0]->cat_ID). '">'. $category[0]->cat_name.' </a></div>';
?>

Leave a Comment