array set title and alt in the_post_thumbnail

Try using get_the_title instead of the_title – from the Function Reference:

  • the_title – Display or retrieve the current post title with optional markup.

  • get_the_title – Retrieve post title.

You might notice that the_title says “Display or retrieve” – and it’s true, you can pass false to the third parameter of the_title to get it’s output as a return value instead of it echo‘ing directly to the page, i.e.

$mytitle = the_title( '', '', false );

EDIT: Updated your code to show this in action:

<?php
if ( has_post_thumbnail() ) {
    $title = get_the_title();
    the_post_thumbnail("mini-me", array(
        'class' => 'x-img smpic x-img-circle',
        'alt'   => $title,
        'title' => $title,
    ) );
}
?>