Catching the error if the WooCommerce donate category is not found
authorLaury GvR <laury@gaslightmedia.com>
Thu, 15 Dec 2016 18:34:42 +0000 (13:34 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 15 Dec 2016 18:34:42 +0000 (13:34 -0500)
parts/glm-blocks.php

index b03d1e0..96fab9a 100644 (file)
@@ -3,9 +3,11 @@
         echo '<h3 class="text-center">Make A Donation</h3>';
         glm_blocks_show();
         echo '<br>';
-        echo '<div class="block-button">
-            <label><a href="'.get_term_link( 236 ,'product_cat').'">Donate Now</a></label>
-        </div>';
+        echo '<div class="block-button">';
+        if (get_term_link( 236 ,'product_cat')) {
+            echo '<label><a href="'.get_term_link( 236 ,'product_cat').'">Donate Now</a></label>';
+        }
+        echo '</div>';
         echo '</div>';
 
     }