-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-loop.php
179 lines (79 loc) · 3.18 KB
/
wp-loop.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
//Si estem a la portada, només mostrem els articles d'actualitat
global $wp_query;
if ( is_home() ) {
$args = array_merge( $wp_query->query_vars, array( 'cat' => '20' ) );
} else {
$args = array_merge( $wp_query->query_vars, array( 'post_type' => array( 'post','guies','page' )) );
}
query_posts( $args );
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<h2><?php if (is_page() || is_single()) { the_title(); ?> <?php } else { ?> <a href="<?php the_permalink() ?>" rel="bookmark"
title="Enllaç permanent a <?php the_title(); ?>"><?php
the_title(); ?></a> <?php } ?></h2>
<?php botons_socials() ?>
<?php if(is_page() || is_single()) { ?>
<div class="post-info">
<?php if(!is_page()) : ?>
<span class="setting filedlink"><?php the_category(', ') ?></span>
<?php comments_popup_link('Cap comentari', 'Un comentari', '% comentaris', 'setting commentslink'); ?>
</span>
<?php edit_post_link($link = 'Edita', $before = '<span class="setting editlink">', $after = '</span>'); ?>
<?php endif; ?>
</div>
<?php } ?>
<div class="post-entry">
<?php if(is_page() || is_single()) { ?>
<?php the_content('Continua llegint »'); ?>
<?php } else { ?>
<ul class='post-meta'>
<?php
$imatge=get_field('imatge');
if( !empty( $image ) ) {
?>
<div class="programa">
<img style="vertical-align:middle"
src="<?php echo esc_url($image['url']); ?>"
alt="<?php echo esc_attr($image['alt']); ?>" />
</div>
<?php
}
?>
<div class="programa_desc"><br /><?=get_post_meta(get_the_ID(),'descripcio_curta',true)?></div>
</ul>
<?php } ?>
</div>
<div class="post-meta">
<?php if(is_single()) : ?>
<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Both Comments and Pings are open
?>
<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Only Pings are Open
?>
Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Comments are open, Pings are not
?>
You can skip to the end and leave a response. Pinging is currently not allowed.
<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Neither Comments, nor Pings are open
?>
Both comments and pings are currently closed.
<?php } ?>
</p>
<?php endif; ?>
</div>
</div>
<?php endwhile; ?>
<?php else : ?>
<div class="post">
<div class="post-entry">
<h2>No s'ha trobat</h2>
<p class="center">Sembla que el que el que esteu cercant no es troba ací.</p>
</div>
</div>
<?php endif; ?>