Пытаюсь вывести в карточке имя пользователя, но выводится сама функция.
Вывод имени
$current_user = wp_get_current_user();
$username = $current_user->display_name;
echo $username;
Полный код
echo '<div class="demo-card-wide mdl-card mdl-shadow--2dp">
<div class="mdl-card__title">
<h2 class="mdl-card__title-text">
<?php
$current_user = wp_get_current_user();
$username = $current_user->display_name;
echo $username;
?>
</h2>
</div>
<div class="mdl-card__supporting-text">
</div>
<div class="mdl-card__actions mdl-card--border">
<a class="mdl-button mdl-button--colored mdl-js-button mdl-js-ripple-effect" href="/account">
Аккаунт
</a>
</div>
<div class="mdl-card__menu">
<button class="mdl-button mdl-button--icon mdl-js-button mdl-js-ripple-effect" onclick="location.href=\'/auth/?action=logout\'">
<i href="/?action-rcl=logout" class="material-icons">exit_to_app</i>
</button>
</div>
</div>';