-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhomepage.php
131 lines (109 loc) · 5.08 KB
/
homepage.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
<?php
/**
* Template Name: Homepage
* @package WordPress
* @subpackage Inspira
* @since Inspira 1.0
*/
get_header(); ?>
<header class="title-img home-video" style="background-image: url('<?php echo get_template_directory_uri(); ?>/img/bg-inspira.jpg')">
<h1><img src="<?php echo get_template_directory_uri(); ?>/img/text-inspira.png" alt="Inspira" /></h1>
<video autoplay loop>
<source src="<?php echo get_template_directory_uri(); ?>/video/inspira-home.mp4" type="video/mp4" />
<source src="<?php echo get_template_directory_uri(); ?>/video/inspira-home.ogv" type="video/ogg" />
</video>
</header>
<section class="home-quote">
<blockquote>
<p>Inspiración que revela el <strong>potencial interior</strong> y expresa el <strong>amor por la vida</strong></p>
</blockquote>
</section>
<section class="home-sub"><div class="contents">
<header>
<h1><img src="<?php echo get_template_directory_uri(); ?>/img/text-inspira-en-movimiento.png" alt="Inspira en Movimiento" /></h1>
<h2>forma parte de nuestros <strong>próximos eventos</strong></h2>
</header>
<?php
$args = array(
'post_type' => 'inspira_events',
'post_status' => 'publish',
'order' => 'asc',
'orderby' => 'meta_value',
'meta_key' => 'inspira_events_enddate',
'meta_value' => date('U'),
'meta_compare' => '>=',
'posts_per_page' => 4
);
$query = new WP_Query($args);
if ( $query->have_posts() ) { ?>
<ul class="events-list">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<li><a href="<?php the_permalink(); ?>" class="hexagon" style="background-image: url('<?php echo wp_get_attachment_image_src( get_post_thumbnail_id(), 'medium', true )[0]; ?>');">
<span class="content">
<span class="info">
<strong><?php the_title(); ?></strong>
<date><?php echo date('d - F - o', get_post_meta(get_the_id(), 'inspira_events_enddate', true) ); ?></date>
</span>
</span>
<span class="face1"></span>
<span class="face2"></span>
</a></li>
<?php endwhile; ?>
</ul>
<?php }
wp_reset_query();
?>
<div class="links">
<a href="<?php echo get_permalink( get_page_by_path('participa') ); ?>#eventos" class="more">Ver más</a>
</div>
</div></section>
<section class="home-news"><div class="contents">
<header>
<h1><img src="<?php echo get_template_directory_uri(); ?>/img/text-inspira-transformacion.png" alt="Inspira Transformación" /></h1>
<h2>equipo <strong>siempre en acción</strong></h2>
</header>
<?php
$feats = array(
'category_name' => 'Featured',
'posts_per_page' => 5
);
$query = new WP_Query($feats);
if ( $query->have_posts() ) { ?>
<div class="news-carousel big-previews-posts owl-carousel">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<article>
<?php the_post_thumbnail(); ?>
<header>
<h1><?php the_title(); ?></h1>
<date><?php the_date(); ?></date>
<a href="<?php echo get_permalink(); ?>" rel="bookmark">Leer más</a>
</header>
</article>
<?php endwhile; ?>
</div>
<?php }
wp_reset_query();
?>
<div class="links">
<a href="<?php echo get_permalink( get_page_by_path('blog') ); ?>" class="more">Más inspiración</a>
</div>
</div></section>
<section class="home-importante"><div class="contents">
<header>
<h1><img src="<?php echo get_template_directory_uri(); ?>/img/text-inspira-importante.png" alt="Inspira es Importante" /></h1>
</header>
<figure>
<img src="<?php echo get_template_directory_uri(); ?>/img/joven-importante.jpg" alt="" />
</figure>
<div class="conts">
<?php
while ( have_posts() ) : the_post();
the_content('');
endwhile;
?>
</div>
</div></section>
<div class="footer-link">
<a href="<?php echo get_permalink( get_page_by_path('nosotros') ); ?>" class="inspirate-btn button yellow">inspírate</a>
</div>
<?php get_footer(); ?>