-
Notifications
You must be signed in to change notification settings - Fork 216
/
archive-documento.php
executable file
·71 lines (63 loc) · 3.11 KB
/
archive-documento.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/**
* The template for displaying archive
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
*
* @package Design_Scuole_Italia
*/
get_header();
global $documento;
?>
<main id="main-container" class="main-container redbrown">
<?php get_template_part("template-parts/common/breadcrumb"); ?>
<?php get_template_part("template-parts/hero/documenti"); ?>
<?php
// recupero la lista delle tipologie
$i=0;
$strutture_documenti = dsi_get_option("strutture_documenti", "documenti");
if($strutture_documenti) {
foreach ($strutture_documenti as $id_tipologia_documento) {
$tipologia_documento = get_term_by("id", $id_tipologia_documento, "tipologia-documento");
if (!is_wp_error($tipologia_documento)) {
$documenti = get_posts("post_type=documento&tipologia-documento=" . $tipologia_documento->slug . "&posts_per_page=6");
if (is_array($documenti) && count($documenti) > 0) {
$i++;
$classcolor = "bg-white";
if ($i % 2)
$classcolor = "bg-gray-light";
?>
<section class="section <?php echo $classcolor; ?> py-5">
<div class="container">
<?php
if (is_array($documenti) && count($documenti) > 0) {
?>
<div class="title-section mb-5">
<h2 class="h4">
<?php if (is_array($documenti) && count($documenti) > 1) echo dsi_pluralize_string($tipologia_documento->name); else echo $tipologia_documento->name; ?>
</h2>
</div><!-- /title-section -->
<div class="row variable-gutters">
<?php foreach ($documenti as $documento) { ?>
<div class="col-lg-4 mb-3 mb-lg-4">
<?php get_template_part("template-parts/documento/card", "ico"); ?>
</div><!-- /col-lg-4 -->
<?php } ?>
</div><!-- /row -->
<div class="pt3 text-center">
<a class="text-underline" href="<?php echo get_term_link($tipologia_documento) ?>"><strong><?php _e("Vedi tutti", "design_scuole_italia"); ?></strong></a>
</div>
<?php
}
?>
</div><!-- /container -->
</section><!-- /section -->
<?php
}
}
}
}
?>
</main>
<?php
get_footer();