Add image size for blocks and remove old widget area
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 3 Mar 2016 15:41:12 +0000 (10:41 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 3 Mar 2016 15:41:12 +0000 (10:41 -0500)
Side widget area not used so removed.
Adding block image size for the blocks

root/functions.php
root/parts/glm-blocks.php

index 1c2e5b9..d3c7fd5 100644 (file)
@@ -11,16 +11,6 @@ if (!function_exists('glm_quicksite_widget_init')) {
 
     function glm_quicksite_widget_init()
     {
-        register_sidebar(array(
-            'name'        => __('Right Sidebar'),
-            'id'          => 'sidebar-r',
-            'description' => __('Appears in Right Sidebar')
-        ));
-        //register_sidebar(array(
-        //    'name'        => __('Footer'),
-        //    'id'          => 'sidebar-f',
-        //    'description' => __('Appears in Footer Area')
-        //));
         register_sidebar(array(
             'name'        => __('Slideshow'),
             'id'          => 'slideshow',
@@ -122,6 +112,11 @@ function mytheme_init() {
 
 add_action('init', 'mytheme_init', 10);
 
+function wpse_setup_theme() {
+    add_image_size('glm-block-image', 290, 190,true);
+}
+
+add_action( 'after_setup_theme', 'wpse_setup_theme' );
 function mytheme_search_loop() {
   while ( have_posts() ) : the_post(); ?>
 
index e8b8594..8f92ed5 100644 (file)
@@ -6,7 +6,7 @@
             <?php if($block->url):?>
             <a href="<?php echo $block->url;?>"<?php if($block->externalUrl){echo ' target="_blank"';}?>>
             <?php endif;?>
-            <?php echo $block->thumbnail;?>
+            <?php echo get_the_post_thumbnail($block->ID, 'glm-block-image');?>
             <?php if($block->url):?>
             </a>
             <?php endif;?>