make the sponsors clickable, if they have a url

This commit is contained in:
Vasil Kolev 2014-10-14 16:23:22 +03:00 committed by Openfest
parent 01ad399aea
commit 4a4bb1a5b0
1 changed files with 9 additions and 1 deletions

View File

@ -24,13 +24,21 @@ get_header(); ?>
while ( $sponsors->have_posts() ) : $sponsors->the_post();
?>
<div class="col2 tac">
<?php
<?php
$custom = get_post_custom();
if (!empty ($custom['url'])) {
echo '<a href="'.$custom['url'][0].'" target=_blank alt="'.get_the_title().'">';
}
if ( has_post_thumbnail() ) {
the_post_thumbnail();
} else {
the_title();
}
if (!empty ($custom['url'])) {
echo '</a>';
}
the_excerpt();
?>
</div>