-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpage-books.php
110 lines (106 loc) · 2.7 KB
/
page-books.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
<?php
/**
* Paperplane Photography Theme
* Template Name: Books
*/
get_header();
$books_page_layout = 'books-list';
$books_page_layout = get_field( 'books_page_layout' );
if ( $books_page_layout === 'books-list' ) :
?>
<?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' => 'book',
//'posts_per_page' => 15,
'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>
<?php include( locate_template( 'template-parts/grid/infinite-message.php' ) ); ?>
</div>
</div>
</div>
<?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 else : ?>
<?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' => 'book',
//'posts_per_page' => 15,
'paged' => $page
);
query_posts( $args_posts_paginati );
$found_posts = $wp_query->found_posts;
?>
<div class="wrapper">
<div class="wrapper-padded">
<div class="flex-hold flex-hold-3 margins-wide books-listing verticalize grid-infinite">
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
include( locate_template( 'template-parts/grid/book-mosaic.php' ) );
endwhile;
endif;
wp_reset_postdata();
?>
</div>
<?php include( locate_template( 'template-parts/grid/infinite-message.php' ) ); ?>
</div>
</div>
<?php endif; ?>
<?php get_footer(); ?>