Check if date of post is yesterday

As you discovered, one possible solution is something like:

<?php $w_h = $w_d = 0; ?>
<?php while (have_posts()) : the_post(); ?>
<?php
    if ( date('Yz') == get_the_time('Yz') ) {
        if (!$w_d++) echo 'Today<br />';
    } elseif ( date('Yz')-1 == get_the_time('Yz') ) {
        if (!$w_h++) echo 'Yesterday<br />';
    } else {
        echo the_date();
    };
?>

error code: 523