-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
127 lines (104 loc) · 4.86 KB
/
index.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
<?php
/**
* @package WordPress
* @subpackage Inspira
* @since Inspira 1.0
*/
get_header(); ?>
<header class="title-banner">
<h1><img src="<?php echo get_template_directory_uri(); ?>/img/text-inspirando-vidas-creando-cambio.png" alt="#InspirandoVidasCreandoCambio" /></h1>
</header>
<?php
$feats = array(
'category_name' => 'Featured',
'posts_per_page' => 5
);
$query = new WP_Query($feats);
if ( $query->have_posts() ) { ?>
<div class="featured-carousel owl-carousel">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<article><a href="<?php echo get_permalink(); ?>" rel="bookmark">
<?php the_post_thumbnail(); ?>
<span class="info">
<strong><?php the_title(); ?></strong>
<small>Leer más > ></small>
</span class="info">
</a></article>
<?php endwhile; ?>
</div>
<?php }
wp_reset_query();
?>
<section class="blog-filters contents">
<form action="<?php echo esc_url( home_url( '/' ) ); ?>">
<fieldset>
<label>Encuentra los post de tu ciudad</label>
<label class="styled-select purple">
<?php
$args = array(
'show_option_all' => 'Todas',
'show_option_none' => ' - ',
'orderby' => 'NAME',
'order' => 'DESC',
'show_count' => 0,
'child_of' => 3,
'echo' => 1,
'name' => 'cat',
'id' => 'ciudades',
'taxonomy' => 'category',
'value_field' => 'term_id'
);
wp_dropdown_categories($args);
?>
</label>
<div class="submit">
<input type="image" src="<?php echo get_template_directory_uri(); ?>/img/btn-busqueda.png" alt="Buscar" />
</div>
</fieldset>
</form>
</section>
<section class="blog"><div class="contents">
<?php get_sidebar(); ?>
<div class="content">
<?php if ( have_posts() ) : ?>
<ol class="simple-posts">
<?php while ( have_posts() ) : the_post(); ?>
<li><article>
<figure><?php the_post_thumbnail('mini-thumb'); ?> </figure>
<header>
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<h3>
<?php
$count = 0;
$categories = get_the_category();
foreach ($categories as $category) {
$count++;
if ($category->cat_name != 'Featured') {
echo '<a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a>';
if( $count != count($categories) ){
echo ', ';
}
}
}
?>
</h3>
</header>
<?php the_excerpt(); ?>
<footer>
<a href="<?php echo get_permalink(); ?>">Leer más »</a>
</footer>
</article></li>
<?php endwhile; ?>
</ol>
<?php else : ?>
<div class="no-results">
<h1>No se encontraron resultados</h1>
<p>Intenta con otra búsqueda.</p>
</div>
<?php endif; ?>
<div class="pagination">
<?php echo paginate_links( ); ?>
</div>
</div>
</div></section>
<?php get_footer(); ?>