-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
132 lines (113 loc) · 5.69 KB
/
Copy pathindex.php
File metadata and controls
132 lines (113 loc) · 5.69 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
/**
* メインテンプレートファイル
*
* @package Backbone_SEO_LLMO
*/
get_header(); ?>
<?php if (have_posts()) : ?>
<?php if (is_home() && !is_front_page()) : ?>
<header class="page-header">
<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
</header>
<?php endif; ?>
<?php while (have_posts()) : ?>
<?php the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php
if (is_singular()) :
the_title('<h1 class="entry-title">', '</h1>');
else :
the_title('<h2 class="entry-title"><a href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h2>');
endif;
?>
<?php if (get_post_type() === 'post') : // 動的チェック ?>
<div class="entry-meta">
<span class="posted-on">
<time class="entry-date published" datetime="<?php echo get_the_date('c'); ?>">
<?php echo get_the_date(); ?>
</time>
</span>
<span class="byline">
<?php echo __('投稿者:', 'backbone-seo-llmo') . ' ' . get_the_author(); ?>
</span>
<?php if (has_category()) : ?>
<span class="cat-links">
<?php echo get_the_category_list(', '); ?>
</span>
<?php endif; ?>
<?php if (has_tag()) : ?>
<span class="tags-links">
<?php echo get_the_tag_list('', ', '); ?>
</span>
<?php endif; ?>
</div>
<?php endif; ?>
</header>
<?php if (has_post_thumbnail() && !is_singular()) : ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('large'); ?>
</a>
</div>
<?php endif; ?>
<div class="entry-content">
<?php
if (is_singular()) :
the_content();
else :
the_excerpt();
endif;
?>
<?php if (!is_singular()) : ?>
<p class="read-more">
<a href="<?php the_permalink(); ?>" class="more-link">
<?php _e('続きを読む', 'backbone-seo-llmo'); ?>
</a>
</p>
<?php endif; ?>
</div>
<?php if (is_singular()) : ?>
<footer class="entry-footer">
<?php
wp_link_pages(array(
'before' => '<div class="page-links">' . __('ページ:', 'backbone-seo-llmo'),
'after' => '</div>',
));
?>
</footer>
<?php endif; ?>
</article>
<?php
// 投稿詳細ページでコメントを表示
if (is_singular() && (comments_open() || get_comments_number())) :
comments_template();
endif;
?>
<?php endwhile; ?>
<?php
// ページネーション
if (!is_singular()) :
backbone_pagination();
endif;
?>
<?php else : ?>
<section class="no-results not-found">
<header class="page-header">
<h1 class="page-title"><?php _e('見つかりません', 'backbone-seo-llmo'); ?></h1>
</header>
<div class="page-content">
<?php if (is_home() && current_user_can('publish_posts')) : ?>
<p><?php printf(__('投稿を開始するには<a href="%1$s">こちらをクリック</a>してください。', 'backbone-seo-llmo'), esc_url(admin_url('post-new.php'))); ?></p>
<?php elseif (is_search()) : ?>
<p><?php _e('お探しのキーワードに一致するものが見つかりませんでした。別のキーワードで検索してみてください。', 'backbone-seo-llmo'); ?></p>
<?php get_search_form(); ?>
<?php else : ?>
<p><?php _e('お探しのページは見つかりませんでした。検索をお試しください。', 'backbone-seo-llmo'); ?></p>
<?php get_search_form(); ?>
<?php endif; ?>
</div>
</section>
<?php endif; ?>
<?php get_footer(); ?>