-
Notifications
You must be signed in to change notification settings - Fork 0
/
content-documentos-acf.php
41 lines (37 loc) · 1.3 KB
/
content-documentos-acf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* The template used for displaying Documentos via ACF
*
* @package WordPress
* @subpackage SH_Base
* @since SH Base 1.0
*/
?>
<?php if(get_field('documentos')): ?>
<?php while ( have_rows('documentos') ) : the_row(); ?>
<div class="bloque-documento">
<?php // elige el icono para el tipo de documento
$doc = get_sub_field('tipo_de_documento');
switch ($doc) {
case 'texto':
$tipo = 'fa-file-text';
break;
case 'pdf':
$tipo = 'fa-file-text';
break;
case 'audio':
$tipo = 'fa-volume-down';
break;
default:
$tipo = ' fa-file';
} ?>
<a class="link-documento" href="<?php the_sub_field('archivo_del_documento'); ?>" rel="<?php the_sub_field('titulo'); ?>">
<div class="tipo-documento"><i class="fa <?php echo $tipo; ?>"></i></div>
<h3><?php the_sub_field('titulo'); ?></h3>
</a>
<p class="descripcion-documento">Descripción: <?php the_sub_field('descripcion_del_archivo'); ?></p>
<a class="descargar-documento" href="<?php the_sub_field('archivo_del_documento'); ?>" rel="<?php the_sub_field('titulo'); ?>"><i class="fa fa-cloud-download fa-2x"></i>
<br />Descargar</a>
</div>
<?php endwhile; ?>
<?php endif; ?>