Skip to content

Commit

Permalink
Fix an undefined in partials/widget-content.php
Browse files Browse the repository at this point in the history
Part of #1492
  • Loading branch information
benlk committed Dec 7, 2018
1 parent a227fd0 commit 01a0977
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions partials/widget-content.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,32 @@

// the thumbnail image (if we're using one)
if ($thumb == 'small') {
$img_location = $instance['image_align'] != '' ? $instance['image_align'] : 'left';
$img_attr = array('class' => $img_location . '-align');
$img_attr['class'] .= " attachment-small"; ?>
<a href="<?php echo get_permalink(); ?>"><?php echo get_the_post_thumbnail( get_the_ID(), '60x60', $img_attr); ?></a>
<?php } elseif ($thumb == 'medium') {
$img_location = $instance['image_align'] != '' ? $instance['image_align'] : 'left';
$img_location = ! empty( $instance['image_align'] ) ? $instance['image_align'] : 'left';
$img_attr = array( 'class' => $img_location . '-align' );
$img_attr['class'] .= " attachment-small";
?>
<a href="<?php echo get_permalink(); ?>"><?php echo get_the_post_thumbnail( get_the_ID(), '60x60', $img_attr); ?></a>
<?php
} elseif ($thumb == 'medium') {
$img_location = ! empty( $instance['image_align'] ) ? $instance['image_align'] : 'left';
$img_attr = array('class' => $img_location . '-align');
$img_attr['class'] .= " attachment-thumbnail"; ?>
<a href="<?php echo get_permalink(); ?>"><?php echo get_the_post_thumbnail( get_the_ID(), 'post-thumbnail', $img_attr); ?></a>
<?php } elseif ($thumb == 'large') {
$img_attr['class'] .= " attachment-thumbnail";
?>
<a href="<?php echo get_permalink(); ?>"><?php echo get_the_post_thumbnail( get_the_ID(), 'post-thumbnail', $img_attr); ?></a>
<?php
} elseif ($thumb == 'large') {
$img_attr = array();
$img_attr['class'] .= " attachment-large"; ?>
<a href="<?php echo get_permalink(); ?>"><?php echo get_the_post_thumbnail( get_the_ID(), 'large', $img_attr); ?></a>
<?php }
$img_attr['class'] .= " attachment-large";
?>
<a href="<?php echo get_permalink(); ?>"><?php echo get_the_post_thumbnail( get_the_ID(), 'large', $img_attr); ?></a>
<?php
}

// the headline and optionally the post-type icon
?><h5>
<a href="<?php echo get_permalink(); ?>"><?php echo get_the_title(); ?>
<?php
if ( isset( $instance['show_icon'] ) && $instance['show_icon'] == true ) {
if ( isset( $instance['show_icon'] ) && $instance['show_icon'] == true ) {
post_type_icon();
}
?>
Expand All @@ -40,8 +46,8 @@
<?php }

// the excerpt
if ($excerpt == 'num_sentences') { ?>
if ( $excerpt == 'num_sentences' ) { ?>
<p><?php echo largo_trim_sentences( get_the_content(), $instance['num_sentences'] ); ?></p>
<?php } elseif ($excerpt == 'custom_excerpt') { ?>
<?php } elseif ( $excerpt == 'custom_excerpt' ) { ?>
<p><?php echo get_the_excerpt(); ?></p>
<?php }

0 comments on commit 01a0977

Please sign in to comment.