-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-noticias.php
55 lines (42 loc) · 1.79 KB
/
page-noticias.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
<?php
/*
Template Name: Noticias
*/
get_header(); ?>
<div class="contenedor-wide">
<h1 class="titulo-noticias"><?php the_title(); ?></h1>
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1 ?>
<?php
$args = array(
'post_type' => 'noticias',
'posts_per_page' => 3,
'orderby' => 'date',
'order' => 'DESC',
'paged' => $paged
);
$noticias = new WP_Query($args); ?>
<div class="contenedor-medium">
<?php while($noticias->have_posts()): $noticias->the_post(); ?>
<div class="cajanoticias" >
<?php the_post_thumbnail('noticias_blog') ?>
<div class="titulo-noticia">
<a href="<?php the_permalink() ?>" class="enlace-resena">
<h2 class="noticia"><?php the_title(); ?></h2>
</a>
</div>
</div>
<?php endwhile; ?>
<?php if ($paged == 1) { ?>
<ul class="paginacion">
<li class="siguientes"><?php next_posts_link('Siguientes »', $noticias->max_num_pages); ?></li>
</ul>
<?php } else { ?>
<ul class="paginacion">
<li class="anteriores"><?php previous_posts_link('« Anteriores', $noticias->max_num_pages); ?></li>
<li class="siguientes"><?php next_posts_link('Siguientes »', $noticias->max_num_pages); ?></li>
</ul>
<?php } ?>
<?php wp_reset_postdata(); ?>
</div>
</div>
<?php get_footer(); ?>