Parse error: syntax error, unexpected ‘;’

Im getting an parse error on this block of code and i can’t figure why. This is the error i get: Parse error: syntax error, unexpected ';' in your code on line 1

    $html = ( isset( $credits ) && empty( $caption ) && '' !== $credits ) || ( isset( $date ) &&  empty( $caption ) && '' !== $date ) ? '<div id="group_it" ' . $style . '>';
    $html .= ( isset( $credits ) && empty( $caption ) && '' !== $credits ) ? '<span class="caption__source">' . $credits . '</span> ' : '';
    $html .= ( isset( $date ) &&  empty( $caption ) && '' !== $date ) ? '<span class="caption__date">' . $date . '</span>' : '';
    $html = ( isset( $credits ) && empty( $caption ) && '' !== $credits ) || ( isset( $date ) &&  empty( $caption ) && '' !== $date ) ? '</div>';
    return $html;

Read more here: Parse error: syntax error, unexpected ‘;’

Leave a Reply

Your email address will not be published. Required fields are marked *