-
-
Save Pross/9ca6b421e10689d94f0f40b8d9b9121c to your computer and use it in GitHub Desktop.
Archive loop
This file contains hidden or 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 = '<i class="fa fa-file-pdf-o" aria-hidden="true"></i>'; | |
break; | |
case 'Word': | |
$icon = '<i class="fa fa-file-word-o" aria-hidden="true"></i>'; | |
break; | |
case 'Image': | |
$icon = '<i class="fa fa-file-image-o" aria-hidden="true"></i>'; | |
break; | |
case 'Arrow': | |
$icon = '<i class="fa fa-arrow-right" aria-hidden="true"></i>'; | |
break; | |
default: | |
$icon = ''; | |
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 echo $icon; ?><?php echo $button_text; ?></a> | |
<?php else: ?> | |
<a href="<?php echo $file;?>" class="std-btn"><?php echo $icon; ?>Download File</a> | |
<?php endif; ?> | |
<?php else: ?> | |
<?php if($button_text): ?> | |
<a href="<?php the_permalink(); ?>" class="std-btn"><?php echo $icon; ?><?php echo $button_text; ?></a> | |
<?php else: ?> | |
<a href="<?php the_permalink(); ?>" class="std-btn"><?php echo $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