質問編集履歴
1
category.php を質問文にコードブロックで追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,4 +32,140 @@
|
|
32
32
|
|
33
33
|
|
34
34
|
|
35
|
+
```
|
36
|
+
|
37
|
+
<?php
|
38
|
+
|
39
|
+
get_header();
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
$theID = get_the_ID();
|
44
|
+
|
45
|
+
?>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
<div id="news-line">
|
52
|
+
|
53
|
+
<div class="container-fluid news-text">
|
54
|
+
|
55
|
+
<div class="row">
|
56
|
+
|
57
|
+
<div class="smp-1">
|
58
|
+
|
59
|
+
<h2><span>NEWS一覧</span></h2>
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
<div class="col-xs-12 col-sm-12 col-sm-offset-0 col-md-6 col-md-offset-3">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div class="topthirty">
|
70
|
+
|
71
|
+
<?php
|
72
|
+
|
73
|
+
$args = array(
|
74
|
+
|
75
|
+
'posts_per_page' => 10,
|
76
|
+
|
77
|
+
'post_type' => 'post',
|
78
|
+
|
79
|
+
'exclude' => $theID
|
80
|
+
|
81
|
+
);
|
82
|
+
|
83
|
+
$posts = get_posts( $args );
|
84
|
+
|
85
|
+
foreach ( $posts as $post ) : setup_postdata( $post );
|
86
|
+
|
87
|
+
$href = get_permalink($post->ID);
|
88
|
+
|
89
|
+
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'post-thumb' );
|
90
|
+
|
91
|
+
$img_url = $thumb['0'];
|
92
|
+
|
93
|
+
$excerpt = $post->post_excerpt ? mb_substr(strip_tags($post->post_excerpt), 0, 120) : mb_substr(strip_tags($post->post_content), 0, 120);
|
94
|
+
|
95
|
+
?>
|
96
|
+
|
97
|
+
<div class="row wht news-line">
|
98
|
+
|
99
|
+
<div class="col-xs-12 col-sm-12 col-md-3">
|
100
|
+
|
101
|
+
<p class="days"><?php the_time( get_option( 'date_format' ) ); ?></p>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
<div class="col-xs-12 col-sm-12 col-md-6">
|
106
|
+
|
107
|
+
<a href="<?php echo esc_url($href); ?>">
|
108
|
+
|
109
|
+
<h3 class="news4 bold1"><?php echo $post->post_title; ?></h3>
|
110
|
+
|
111
|
+
</a>
|
112
|
+
|
113
|
+
<p class="next-p text-justify">
|
114
|
+
|
115
|
+
<?php echo wp_trim_words( get_the_content(), 100, '...' ); ?>
|
116
|
+
|
117
|
+
</p>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<div class="col-xs-12 col-sm-12 col-md-3">
|
122
|
+
|
123
|
+
<a href="<?php echo esc_url($href); ?>">
|
124
|
+
|
125
|
+
<div class="pic">
|
126
|
+
|
127
|
+
<img src="<?php echo esc_url($img_url); ?>" alt="<?php echo $post->post_title; ?>" class="img-responsive same-size"/>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
</a>
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<?php
|
138
|
+
|
139
|
+
endforeach;
|
140
|
+
|
141
|
+
wp_reset_postdata();
|
142
|
+
|
143
|
+
?>
|
144
|
+
|
145
|
+
<div class="view2">
|
146
|
+
|
147
|
+
<?php wp_pagenavi(); ?>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
</div>
|
152
|
+
|
153
|
+
</div>
|
154
|
+
|
155
|
+
</div>
|
156
|
+
|
157
|
+
</div>
|
158
|
+
|
159
|
+
</div>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
<?php get_footer(); ?>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
```
|
168
|
+
|
169
|
+
|
170
|
+
|
35
171
|
何卒よろしくお願い致します。
|