Create new thumbnail size for blocks
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 30 Mar 2015 16:12:17 +0000 (12:12 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 30 Mar 2015 16:12:17 +0000 (12:12 -0400)
make them 269 x 190

front-page.php
functions.php

index 30ca0f7..c59800d 100644 (file)
@@ -27,7 +27,7 @@
                             <?php endif;?>
                             <?php
                                 //echo $block->thumbnail;
-                                echo get_the_post_thumbnail($block->ID, array(269, 190), array('class' => 'aligncenter'));
+                                echo get_the_post_thumbnail($block->ID, 'block-thumbnail', array('class' => 'aligncenter'));
                             ?>
                             <?php if($block->url):?>
                             </a>
index 9223856..3605a4a 100644 (file)
@@ -112,6 +112,10 @@ function glm_offcanvas_menu()
 
 add_theme_support('post-thumbnails');
 set_post_thumbnail_size(120, 100, true);
+function glm_theme_image_setup()
+{
+    add_image_size('block-thumbnail', 269, 190, true);
+}
 /**
  * glm_site_scripts
  *
@@ -140,7 +144,7 @@ function glm_site_scripts()
 function GLM_get_header() {
     echo '<div';
 
-    add_theme_support( 'post-thumbnails' ); 
+    add_theme_support( 'post-thumbnails' );
     if (has_post_thumbnail()) {
             $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full");
             echo ' style="background-image: url('.$image_data[0].');height:0;padding:0;padding-bottom:20%;background-position:center center;background-size: 100%;background-repeat:no-repeat;';