update order
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 25 Nov 2014 15:18:12 +0000 (10:18 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 25 Nov 2014 15:18:12 +0000 (10:18 -0500)
models/block.php
views/front/showBlocks.php

index 59c29f0..3200d7c 100644 (file)
@@ -122,8 +122,8 @@ class glm_models_block
     {
         global $wpdb, $wp;
         $args   = array(
-            'post_type' => 'glm_blocks',
-            'orderby'   => 'menu_order, post_title',
+            'post_type' => GLM_BLOCK_POST_TYPE,
+            'orderby'   => 'menu_order post_title',
             'order'     => 'asc'
         );
         $blocks = get_posts($args);
index 7c6bc92..f2f4d3c 100644 (file)
@@ -1,7 +1,13 @@
 <?php foreach ($blocks as $block):?>
 <div class="text-center small-12 medium-12 medium-centered large-uncentered large-4 columns">
         <?php echo $block->thumbnail;?>
-        <a class="title-posts" href="<?php echo $block->url;?>"><h2><?php echo $block->post_title;?></h2></a>
+        <?php if($block->url):?>
+        <a class="title-posts" href="<?php echo $block->url;?>">
+        <?php endif;?>
+            <h2><?php echo $block->post_title;?></h2>
+        <?php if($block->url):?>
+        </a>
+         <?php endif;?>
     <?php echo $block->post_excerpt;?>
 </div>
 <?php endforeach;?>
\ No newline at end of file