-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpage-news.php
63 lines (59 loc) · 1.47 KB
/
page-news.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
<?php
/**
* Paperplane Photography Theme
* Template Name: News
*/
get_header();
?>
<?php while (have_posts()):
the_post(); ?>
<div class="wrapper">
<div class="wrapper-padded">
<div class="wrapper-padded-more-650">
<div class="content-styled plain-page">
<h1 class="aligncenter">
<?php the_title(); ?>
</h1>
<?php the_content(); ?>
</div>
</div>
</div>
</div>
<?php endwhile;
wp_reset_postdata(); ?>
<?php
$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args_posts_paginati = array(
'post_type' => 'news',
//'posts_per_page' => 20,
'paged' => $page
);
query_posts($args_posts_paginati);
$found_posts = $wp_query->found_posts;
?>
<div class="wrapper">
<div class="wrapper-padded">
<div class="wrapper-padded-more-650">
<div class="news-grid grid-infinite">
<?php
if (have_posts()):
while (have_posts()):
the_post();
include(locate_template('template-parts/grid/news.php'));
endwhile;
endif;
wp_reset_postdata();
?>
</div>
</div>
</div>
</div>
<?php include(locate_template('template-parts/grid/infinite-message.php')); ?>
<?php if ($found_posts > $posts_per_page): ?>
<div class="wrapper aligncenter">
<div class="view-more-button view-more-button-js">
<?php _e('View more', 'paperplane-photography-theme'); ?>
</div>
</div>
<?php endif; ?>
<?php get_footer(); ?>