-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
62 lines (56 loc) · 1.99 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
<?php get_header(); ?>
<main id="blog">
<div class="wrapper">
<section class="full-width">
<div class="page-title">
<h1>El blog de uiFromMars</h1>
<p>Impulsa tu carrera ampliando tus conocimientos en diseño de producto digital, diseño de interfaz,
investigación UX, portfolio y mucho más con artículos detallados y casos de estudio.</p>
</div>
<div class="content-grid">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'posts_per_page' => 18,
'paged' => $paged,
);
$last_posts = new WP_Query($args);
if ($last_posts->have_posts()) :
while ($last_posts->have_posts()) : $last_posts->the_post(); ?>
<article class="home-item">
<a href="<?php the_permalink(); ?>" aria-label="Lee más sobre <?php the_title(); ?>" class="category-image">
<?php the_post_thumbnail('blog-thumbnails'); ?>
</a>
<span class="pill"><?php the_category(' ') ?></span>
<h2 class="post-title-home">
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</h2>
</article>
<?php endwhile; ?>
</div> <!-- Close content-grid div here -->
<?php
wp_reset_postdata();
else :
echo '<p>No posts found</p>';
endif;
?>
</section>
<nav class="pagination">
<?php
echo paginate_links(array(
'base' => str_replace(9999999999, '%#%', esc_url(get_pagenum_link(9999999999))),
'current' => max(1, get_query_var('paged')),
'total' => $last_posts->max_num_pages, // Use $last_posts instead of $wp_query
'end_size' => 0,
'mid_size' => 3,
'prev_next' => true,
'prev_text' => __('«'),
'next_text' => __('»'),
));
?>
</nav>
</div>
</main>
<?php get_footer(); ?>