This repository has been archived by the owner on Dec 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
event-list.php
72 lines (58 loc) · 1.58 KB
/
event-list.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
<?php
/*
* Template Name: event-list
*/
get_header();
?>
<article id="content">
<header class="entry-header">
<h1 class="post-title">イベント</h1>
<p class="add-button">
<a class="button button-white"
href="<?php echo admin_url('post-new.php?post_type=event'); ?>">
新しいイベントを登録する
</a>
</p>
</header>
<?php
$paged = get_query_var('paged');
$posts = query_posts(array("post_type" => array("event"),
"paged" => $paged,
"posts_par_page" => 5,
"meta_key " => $_GET['key'],
"meta_value" => $_GET['value'],
"orderby" => "date"));
?>
<?php
if (have_posts()) :
foreach ($posts as $post) :
setup_postdata($post);
$the_id = get_the_ID();
?>
<section class="event-section">
<header class="event-header">
<h1 class="event-title">
<?php
$title = get_the_title();
?>
<a href="<?php the_permalink() ?>" title="<?php echo esc_attr($title); ?>">
<?php echo esc_html($title); ?>
</a>
</h1>
</header>
<footer class="event-footer">
<?php the_metadata_of_event($the_id); ?>
<div class="event-summary">
<?php the_excerpt(); ?>
</div>
</footer>
</section>
<?php
endforeach;
endif;
?>
<nav class="navigation">
<?php navigation_bar(); ?>
</nav>
</article>
<?php get_footer(); ?>