Created
December 21, 2017 14:47
-
-
Save richsalvucci/fefc4239efc7ddfb539e9e4c704c398d to your computer and use it in GitHub Desktop.
Archive loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$resource = pods('resource', get_the_id()); | |
$short_description = $resource -> display('short_description'); | |
$item_reference_link = $resource -> display('item_reference_link'); | |
$button_text = $resource -> display('button_text'); | |
$button_icon = $resource -> display('button_icon'); | |
$preview_image = $resource -> display('preview_image'); | |
var_dump($button_icon); | |
switch ($button_icon) { | |
case 'PDF': | |
$icon = echo '<i class="fa fa-file-pdf-o" aria-hidden="true"></i>'; | |
break; | |
case 'Word': | |
$icon = echo '<i class="fa fa-file-word-o" aria-hidden="true"></i>'; | |
break; | |
case 'Image': | |
$icon = echo '<i class="fa fa-file-image-o" aria-hidden="true"></i>'; | |
break; | |
case 'Arrow'; | |
$icon = echo '<i class="fa fa-arrow-right" aria-hidden="true"></i>'; | |
break; | |
default: | |
$icon = echo ''; | |
break; | |
} | |
?> | |
<div class="col-sm-3"> | |
<div class="resource-tile"> | |
<div class="resource-title"> | |
<?php if($item_reference_link): ?> | |
<a href="<?php echo $item_reference_link;?>"><h4><?php the_title(); ?></h4></a> | |
<?php else: ?> | |
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><h4><?php the_title(); ?></h4></a> | |
<?php endif; ?> | |
</div> | |
<div class="resource-description"> | |
<p><?php echo $short_description; ?></p> | |
</div> | |
<div class="resource-button"> | |
<?php if($file): ?> | |
<?php if($button_text): ?> | |
<a href="<?php echo $file;?>" class="std-btn"><?php $icon; ?><?php echo $button_text; ?></a> | |
<?php else: ?> | |
<a href="<?php echo $file;?>" class="std-btn"><?php $icon; ?>Download File</a> | |
<?php endif; ?> | |
<?php else: ?> | |
<?php if($button_text): ?> | |
<a href="<?php the_permalink(); ?>" class="std-btn"><?php $icon; ?><?php echo $button_text; ?></a> | |
<?php else: ?> | |
<a href="<?php the_permalink(); ?>" class="std-btn"><?php $icon; ?>Resource</a> | |
<?php endif; ?> | |
<?php endif; ?> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment