-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.php
152 lines (147 loc) · 5.95 KB
/
home.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
<?php if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die('Por favor no cargue esta página directamente. ¡Gracias!'); } ?>
<?php get_header(); ?>
<div class="container-fluid"> <!-- Inicia .container (coloca al centro la estructura de la página) -->
<!-- Jumbotron
================================================== -->
<div id="jumbohome" class="jumbotron mb-30px p-4 p-md-5 text-white rounded bg-dark">
<div class="col-md-6 px-0">
<h1 class="display-4 font-italic">Bienvenido a mi blog personal</h1>
<p class="lead my-3">Desde aquí hablo un poco de EdTech, Thinkpads, LEGO, Linux, Redes, Seguridad y Medicina.</p>
<p class="lead mb-0"><a href="https://moisesserrano.com/sobre-mi/" class="text-white font-weight-bold">Conoce un poco más sobre lo que hago...</a></p>
</div>
</div>
<!-- Cierra Jumbotron
================================================== -->
<!-- Contenido principal
================================================== -->
<div class="main-content">
<?php
$featured_loop = new WP_Query(
array(
'post_type' => 'post',
'posts_per_page' => 2,
'category_name' => 'destacado',
//'order' => 'ASC',
//'orderby' => 'name'
)
);
?>
<?php if ( $featured_loop->have_posts() ): ?>
<!-- Posts Destacados
================================================== -->
<section class="featured-posts">
<div class="section-title"><h2><span>Más visitados</span></h2></div>
<div class="row"><!-- inicio fila -->
<?php while ( $featured_loop->have_posts() ) : $featured_loop->the_post(); ?>
<?php $featured_img_url = get_the_post_thumbnail_url(get_the_ID(), 'medium_large');?>
<!-- inicio post -->
<div class="col-md-6 mb-30px">
<div class="listfeaturedtag h-100">
<div class="row h-100">
<div class="col-12 col-md-12 col-lg-5 pr-lg-0">
<div class="h-100">
<div class="wrapthumbnail">
<a href="<?php the_permalink(); ?>"><img class="featured-box-img-cover" src="<?php echo $featured_img_url; ?>" alt="<?php the_title(); ?>" /></a>
</div>
</div>
</div>
<div class="col-12 col-md-12 col-lg-7">
<div class="h-100 card-group">
<div class="card">
<div class="card-body">
<h2 class="card-title"><a class="text-dark" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<h4 class="card-text"><?php the_excerpt(); ?></h4>
</div>
<div class="card-footer b-0 bg-white mt-auto">
<div class="wrapfooter">
<span class="meta-footer-thumb profile-author">
<a href="#"><?php echo get_avatar( get_the_author_meta( 'user_email' ), 72 ); ?></a>
</span>
<span class="author-meta">
<span class="post-name"><a target="_blank" href="#"><?php the_author(); ?></a></span><br/>
<span class="post-date"><?php echo get_the_date('j M Y'); ?></span>
<span class="dot"></span>
<span class="post-read"><?php echo gallo_reading_time(); ?></span>
</span>
<span class="post-read-more"><a href="<?php the_permalink(); ?>" title="Leer historia"><i class="fas fa-bookmark"></i></a></span>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- fin post -->
<?php endwhile; ?>
</div> <!-- fin fila -->
</section>
<?php endif; ?>
<?php wp_reset_query(); ?>
<!-- intermezzo -->
<?php
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$home_loop = new WP_Query(
array(
'post_type' => 'post',
'posts_per_page' => 6,
'paged' => $paged,
//'order' => 'ASC',
//'orderby' => 'name'
)
);
?>
<?php if ( $home_loop->have_posts() ) { ?>
<!-- Todos los posts
================================================== -->
<section class="recent-posts">
<div class="section-title"><h2><span>Todas las historias</span></h2></div>
<div class="row listrecent"> <!-- inicio fila recientes -->
<?php while ( $home_loop->have_posts() ) : $home_loop->the_post(); ?>
<?php $home_img_url = get_the_post_thumbnail_url(get_the_ID(), 'medium_large');?>
<!-- inicio post -->
<div id="post-<?php the_ID(); ?>" class="col-lg-4 col-md-6 mb-30px card-group">
<div class="card h-100">
<div class="maxthumb">
<a href="<?php the_permalink(); ?>"><img class="img-fluid" src="<?php echo $home_img_url; ?>" alt="<?php the_title(); ?>" /></a>
</div>
<div class="card-body">
<h2 class="card-title"><a class="text-dark" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<h4 class="card-text"><?php the_excerpt(); ?></h4>
</div>
<div class="card-footer bg-white">
<div class="wrapfooter">
<span class="meta-footer-thumb profile-author">
<a href="#"><?php echo get_avatar( get_the_author_meta( 'user_email' ), 72 ); ?></a>
</span>
<span class="author-meta">
<span class="post-name"><a target="_blank" href="#"><?php the_author(); ?></a></span><br/>
<span class="post-date"><?php echo get_the_date('j M Y'); ?></span>
<span class="dot"></span>
<span class="post-read"><?php echo gallo_reading_time(); ?></span>
</span>
<span class="post-read-more"><a href="<?php the_permalink(); ?>" title="Leer historia"><i class="fas fa-bookmark"></i></a></span>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>
<!-- end post -->
<?php endwhile; ?>
</div> <!-- fin fila recientes -->
</section>
<!-- Paginación
================================================== -->
<div class="bottompagination">
<div class="pointerup"><i class="fa fa-caret-up"></i></div>
<span class="navigation" role="navigation">
<?php gallo_posts_nav(); ?>
</span>
</div>
<!-- Fin Paginación
================================================== -->
<?php } ?>
</div><!-- cierra .main-content -->
</div> <!-- cierra .container -->
<?php get_footer(); ?>