-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
94 lines (87 loc) · 2.19 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
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
<?php
get_header();
$notice_query = new WP_Query( [
'category_name' => 'notice',
'posts_per_page' => 5,
] );
$new_book_query = new WP_Query( [
'meta_key' => 'published_date',
'orderby' => 'meta_value',
'order' => 'DESC',
'post_type' => 'book',
'posts_per_page' => 5,
] );
$mytory_books_query = new WP_Query( [
'post_type' => 'book',
'tax_query' => [
[
'taxonomy' => 'book_publisher',
'field' => 'slug',
'terms' => 'mytory북스',
]
],
'posts_per_page' => 5,
'meta_key' => 'published_date',
'orderby' => 'meta_value',
] );
require 'templates/main-slider.php';
?>
<div class="wrapper">
<div class="layout-2-column">
<div class="layout-item">
<h2>신간</h2>
<ul>
<?php
if ( $new_book_query->have_posts() ) {
while ( $new_book_query->have_posts() ) {
$new_book_query->the_post(); ?>
<li>
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a>
</li>
<?php
}
wp_reset_postdata();
} ?>
</ul>
</div>
<div class="layout-item">
<h2>공지사항</h2>
<ul>
<?php
if ( $notice_query->have_posts() ) {
while ( $notice_query->have_posts() ) {
$notice_query->the_post(); ?>
<li>
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a>
</li>
<?php
}
wp_reset_postdata();
} ?>
</ul>
</div>
<div class="layout-item">
<h2>Mytory북스의 책들</h2>
<ul>
<?php
if ( $mytory_books_query->have_posts() ) {
while ( $mytory_books_query->have_posts() ) {
$mytory_books_query->the_post(); ?>
<li>
<a href="<?php the_permalink() ?>">
<?php the_title(); ?>
</a>
</li>
<?php
}
wp_reset_postdata();
} ?>
</ul>
</div>
</div>
</div>
<?php get_footer() ?>