make the sponsors clickable, if they have a url
This commit is contained in:
parent
da6dc132c7
commit
01ad399aea
|
@ -73,11 +73,19 @@ function sponsors_shortcode() {
|
||||||
|
|
||||||
if ( $sponsors->have_posts() ) :
|
if ( $sponsors->have_posts() ) :
|
||||||
while ( $sponsors->have_posts() ) : $sponsors->the_post();
|
while ( $sponsors->have_posts() ) : $sponsors->the_post();
|
||||||
|
$custom = get_post_custom();
|
||||||
|
if (!empty ($custom['url'])) {
|
||||||
|
echo '<a href="'.$custom['url'][0].'" target=_blank alt="'.get_the_title().'">';
|
||||||
|
}
|
||||||
if ( has_post_thumbnail() ) {
|
if ( has_post_thumbnail() ) {
|
||||||
the_post_thumbnail();
|
the_post_thumbnail();
|
||||||
} else {
|
} else {
|
||||||
get_the_title();
|
get_the_title();
|
||||||
}
|
}
|
||||||
|
if (!empty ($custom['url'])) {
|
||||||
|
echo '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
endwhile;
|
endwhile;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue