Display post excerpt instead of content, if available

Change line 9 to:

$content = get_the_excerpt();

the_excerpt() echoes the excerpt. get_the_excerpt() returns it.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)