Update the image size for the glm blocks
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 29 Oct 2015 20:08:39 +0000 (16:08 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 29 Oct 2015 20:08:59 +0000 (16:08 -0400)
Use custom image size of 305 x 215 and crop

functions.php
parts/glm-blocks.php

index 4124e8e..7ef15bd 100644 (file)
@@ -321,6 +321,7 @@ add_action('after_setup_theme', 'bpla_theme_setup');
 function bpla_theme_setup()
 {
     add_image_size( 'bpla-drop-down', 219, 169, true );
+    add_image_size( 'glm-block-thumbnail', 305, 215, true );
 }
 // End of the Contextual/Highlight Search functions
 ?>
index 46d1f85..7887768 100644 (file)
@@ -7,7 +7,11 @@
             <?php if($block->url):?>
             <a href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
             <?php endif;?>
-            <?php echo $block->thumbnail;?>
+            <?php
+            $block->thumbnail = get_the_post_thumbnail(
+                $block->ID, 'glm-block-thumbnail', array('class' => 'aligncenter')
+            );
+            echo $block->thumbnail;?>
             <?php if($block->url):?>
             </a>
             <?php endif;?>