forked from italia/design-scuole-wordpress-theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpersone.php
executable file
·125 lines (111 loc) · 6.37 KB
/
persone.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/* Template Name: Persone
*
* didattica template file
*
* @package Design_Scuole_Italia
*/
global $post;
get_header();
?>
<main id="main-container" class="main-container bluelectric">
<?php get_template_part("template-parts/common/breadcrumb"); ?>
<?php
while ( have_posts() ) :
the_post();
get_template_part("template-parts/hero/persone");
// recupero la lista delle strutture
$i=0;
$strutture_persone = dsi_get_option("strutture_persone", "persone");
if($strutture_persone) {
foreach ($strutture_persone as $idstruttura) {
$i++;
$struttura = get_post($idstruttura);
$classcolor = "bg-white";
if ($i % 2)
$classcolor = "bg-gray-light";
$responsabile = dsi_get_meta("responsabile", "_dsi_struttura_", $struttura->ID);
$persone = dsi_get_meta("persone", "_dsi_struttura_", $struttura->ID);
$altri_componenti = dsi_get_meta("altri_componenti", "_dsi_struttura_", $struttura->ID);
?>
<section class="section <?php echo $classcolor; ?> py-5">
<div class="container">
<div class="title-section text-center mb-5">
<h2 class="h4"><a
href="<?php echo get_permalink($struttura); ?>"><?php echo $struttura->post_title; ?></a>
</h2>
</div><!-- /title-large -->
<?php if (is_array($responsabile) && count($responsabile) > 0) { ?>
<div class="row variable-gutters mb-4">
<div class="col-lg-3">
<h3 class="text-lg-right mb-3"><?php _e("Responsabile", "design_scuole_italia"); ?></h3>
</div><!-- /col-lg-3 -->
<div class="col-lg-9">
<div class="row variable-gutters">
<?php
foreach ($responsabile as $idutente) {
$autore = get_user_by("ID", $idutente);
?>
<div class="col-lg-4">
<div class="card card-bg bg-color bg-dark card-avatar rounded mb-3">
<div class="card-body">
<?php get_template_part("template-parts/autore/card", "insegnante"); ?>
</div><!-- /card-body -->
</div><!-- /card card-bg card-avatar rounded -->
</div><!-- /col-lg-4 -->
<?php
}
?>
</div><!-- /row -->
</div><!-- /col-lg-9 -->
</div><!-- /row -->
<?php } ?>
<?php if (is_array($persone) && count($persone) > 0) { ?>
<div class="row variable-gutters mb-4">
<div class="col-lg-3">
<h4 class="text-lg-right mb-3"><?php _e("Persone", "design_scuole_italia"); ?></h4>
</div><!-- /col-lg-3 -->
<div class="col-lg-9">
<div class="row variable-gutters">
<?php
foreach ($persone as $idutente) {
$autore = get_user_by("ID", $idutente);
?>
<div class="col-lg-4">
<div class="card card-bg bg-white card-avatar rounded mb-3">
<div class="card-body">
<?php get_template_part("template-parts/autore/card", "insegnante"); ?>
</div><!-- /card-body -->
</div><!-- /card card-bg card-avatar rounded -->
</div><!-- /col-lg-4 -->
<?php
}
?>
</div><!-- /row -->
</div><!-- /col-lg-9 -->
</div><!-- /row -->
<?php } ?>
<?php if ($altri_componenti != "") { ?>
<div class="row variable-gutters mb-4">
<div class="col-lg-3">
<h3 class="h4 text-lg-right mb-3"><?php _e("Componenti esterni", "design_scuole_italia"); ?></h3>
</div><!-- /col-lg-3 -->
<div class="col-lg-9">
<div class="row variable-gutters">
<span class="h5 text-lg-right mb-3 pt-1 pl-4">
<?php echo $altri_componenti; ?>
</span>
</div><!-- /row -->
</div><!-- /col-lg-9 -->
</div><!-- /row -->
<?php } ?>
</div><!-- /container -->
</section><!-- /section -->
<?php
}
}
endwhile; // End of the loop.
?>
</main>
<?php
get_footer();