New default product detail image & product tag default image
authorLaury GvR <laury@gaslightmedia.com>
Tue, 5 Nov 2019 18:40:10 +0000 (13:40 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 5 Nov 2019 18:40:10 +0000 (13:40 -0500)
assets/default-product-featured.jpg [new file with mode: 0644]
assets/default-product-featured.png [deleted file]
functions.php
index.php

diff --git a/assets/default-product-featured.jpg b/assets/default-product-featured.jpg
new file mode 100644 (file)
index 0000000..c7f780b
Binary files /dev/null and b/assets/default-product-featured.jpg differ
diff --git a/assets/default-product-featured.png b/assets/default-product-featured.png
deleted file mode 100755 (executable)
index f024fa2..0000000
Binary files a/assets/default-product-featured.png and /dev/null differ
index d746c10..9ee2ef2 100644 (file)
@@ -258,6 +258,10 @@ function glm_get_header() {
             $tagID = $tag->term_id;
         
             $thumbnail = z_taxonomy_image_url( (int)$object->object_id );
+
+            if (!$thumbnail) {
+                $thumbnail = get_template_directory_uri().'/assets/default-product-featured.png';
+            }
         
             echo ' style="background-image: url('.$thumbnail.');padding:0;padding-bottom:20%;background-position:center center;background-size: cover;background-repeat:no-repeat;max-height: 370px; "';
             
index c31b69d..f28a4e7 100644 (file)
--- a/index.php
+++ b/index.php
                     <?php endif;?>
                 </div>
             </div>
-              <?php if (is_page(101)) { 
-                    $terms = get_terms( 'product_tag' );
-                    $term_array = array();
-    
-                    if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ ?>
-                    <div class="row">
-                       <div id="tours-tags-grid-container">
-                            <ul id="tours-tags-grid">
-                        <?php foreach ( $terms as $term ) {
-                             $thumbnail = z_taxonomy_image_url( $term->term_id ); ?>
+            <?php if (is_page(101)) { 
+                $terms = get_terms( 'product_tag' );
+                $term_array = array();
+
+                if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ ?>
+                <div class="row">
+                    <div id="tours-tags-grid-container">
+                        <ul id="tours-tags-grid">
+                            <?php foreach ( $terms as $term ) {
+                                $thumbnail = z_taxonomy_image_url( $term->term_id ); ?>
                                 <?php if( empty( $thumbnail ) ){
                                     $thumbnail = get_template_directory_uri() . '/assets/header-images-2.jpg';
-                             }?>
-                            <li class="tour_tag"><div class="tag_image" style="height: 200px; width: 200px;background: url('<?php echo $thumbnail; ?> ') no-repeat center center;background-size: cover;"></div><a href=" <?php echo get_term_link($term->term_id); ?>"> <?php echo  $term->name; ?> </a></li>
-                      <?php }
-                    }
-                  } ?>
-                </ul>
-                </div>
-            </div>
+                                }?>
+                                <li class="tour_tag">
+                                    <div class="tag_image" style="height: 200px; width: 200px;background: url('<?php echo $thumbnail; ?> ') no-repeat center center;background-size: cover;">
+                                    </div>
+                                    <a href=" <?php echo get_term_link($term->term_id); ?>"> <?php echo  $term->name; ?> </a>
+                                </li>
+                            <?php } ?>
+                        </ul>
+                    </div>
+                <?php } ?>
+            <?php } ?>
         </div>
 <?php get_footer(); ?>