{
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);
<?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