質問編集履歴
2
style.cssの「site-main」の記載がある部分を追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -373,3 +373,241 @@
|
|
373
373
|
</article><!-- #post-<?php the_ID(); ?> -->
|
374
374
|
|
375
375
|
```
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
```
|
380
|
+
|
381
|
+
//style.cssの「site-main」に関連した部分のみ抜粋:その1
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
/* Blog landing, search, archives */
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
.blog .site-main > article,
|
390
|
+
|
391
|
+
.archive .site-main > article,
|
392
|
+
|
393
|
+
.search .site-main > article {
|
394
|
+
|
395
|
+
padding-bottom: 1em;
|
396
|
+
|
397
|
+
}
|
398
|
+
|
399
|
+
|
400
|
+
|
401
|
+
body:not(.twentyseventeen-front-page) .entry-header {
|
402
|
+
|
403
|
+
padding: 1em 0;
|
404
|
+
|
405
|
+
}
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
body:not(.twentyseventeen-front-page) .entry-header,
|
410
|
+
|
411
|
+
body:not(.twentyseventeen-front-page) .entry-content,
|
412
|
+
|
413
|
+
body:not(.twentyseventeen-front-page) #comments {
|
414
|
+
|
415
|
+
margin-left: auto;
|
416
|
+
|
417
|
+
margin-right: auto;
|
418
|
+
|
419
|
+
}
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
body:not(.twentyseventeen-front-page) .entry-header {
|
424
|
+
|
425
|
+
padding-top: 0;
|
426
|
+
|
427
|
+
}
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
.blog .entry-meta a.post-edit-link,
|
432
|
+
|
433
|
+
.archive .entry-meta a.post-edit-link,
|
434
|
+
|
435
|
+
.search .entry-meta a.post-edit-link {
|
436
|
+
|
437
|
+
color: #222;
|
438
|
+
|
439
|
+
display: inline-block;
|
440
|
+
|
441
|
+
margin-left: 1em;
|
442
|
+
|
443
|
+
white-space: nowrap;
|
444
|
+
|
445
|
+
}
|
446
|
+
|
447
|
+
|
448
|
+
|
449
|
+
.search .page .entry-meta a.post-edit-link {
|
450
|
+
|
451
|
+
margin-left: 0;
|
452
|
+
|
453
|
+
white-space: nowrap;
|
454
|
+
|
455
|
+
}
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
.taxonomy-description {
|
460
|
+
|
461
|
+
color: #666;
|
462
|
+
|
463
|
+
font-size: 13px;
|
464
|
+
|
465
|
+
font-size: 0.8125rem;
|
466
|
+
|
467
|
+
}
|
468
|
+
|
469
|
+
|
470
|
+
|
471
|
+
////////////////////
|
472
|
+
|
473
|
+
//style.cssの「site-main」に関連した部分のみ抜粋:その2
|
474
|
+
|
475
|
+
/* Blog, archive, search */
|
476
|
+
|
477
|
+
|
478
|
+
|
479
|
+
.sticky .icon-thumb-tack {
|
480
|
+
|
481
|
+
height: 23px;
|
482
|
+
|
483
|
+
left: -2.5em;
|
484
|
+
|
485
|
+
top: 1.5em;
|
486
|
+
|
487
|
+
width: 32px;
|
488
|
+
|
489
|
+
}
|
490
|
+
|
491
|
+
|
492
|
+
|
493
|
+
body:not(.has-sidebar):not(.page-one-column) .page-header,
|
494
|
+
|
495
|
+
body.has-sidebar.error404 #primary .page-header,
|
496
|
+
|
497
|
+
body.page-two-column:not(.archive) #primary .entry-header,
|
498
|
+
|
499
|
+
body.page-two-column.archive:not(.has-sidebar) #primary .page-header {
|
500
|
+
|
501
|
+
float: left;
|
502
|
+
|
503
|
+
width: 36%;
|
504
|
+
|
505
|
+
}
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
.blog:not(.has-sidebar) #primary article,
|
510
|
+
|
511
|
+
.archive:not(.page-one-column):not(.has-sidebar) #primary article,
|
512
|
+
|
513
|
+
.search:not(.has-sidebar) #primary article,
|
514
|
+
|
515
|
+
.error404:not(.has-sidebar) #primary .page-content,
|
516
|
+
|
517
|
+
.error404.has-sidebar #primary .page-content,
|
518
|
+
|
519
|
+
body.page-two-column:not(.archive) #primary .entry-content,
|
520
|
+
|
521
|
+
body.page-two-column #comments {
|
522
|
+
|
523
|
+
float: right;
|
524
|
+
|
525
|
+
width: 58%;
|
526
|
+
|
527
|
+
}
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
.blog .site-main > article,
|
532
|
+
|
533
|
+
.archive .site-main > article,
|
534
|
+
|
535
|
+
.search .site-main > article {
|
536
|
+
|
537
|
+
padding-top: 4em;
|
538
|
+
|
539
|
+
padding-bottom: 4em;
|
540
|
+
|
541
|
+
}
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
.navigation.pagination {
|
546
|
+
|
547
|
+
clear: both;
|
548
|
+
|
549
|
+
float: right;
|
550
|
+
|
551
|
+
width: 58%;
|
552
|
+
|
553
|
+
}
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
.has-sidebar .navigation.pagination,
|
558
|
+
|
559
|
+
.archive.page-one-column:not(.has-sidebar) .navigation.pagination {
|
560
|
+
|
561
|
+
float: none;
|
562
|
+
|
563
|
+
width: 100%;
|
564
|
+
|
565
|
+
}
|
566
|
+
|
567
|
+
|
568
|
+
|
569
|
+
.entry-footer {
|
570
|
+
|
571
|
+
display: table;
|
572
|
+
|
573
|
+
width: 100%;
|
574
|
+
|
575
|
+
}
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
.entry-footer .cat-tags-links {
|
580
|
+
|
581
|
+
display: table-cell;
|
582
|
+
|
583
|
+
vertical-align: middle;
|
584
|
+
|
585
|
+
width: 100%;
|
586
|
+
|
587
|
+
}
|
588
|
+
|
589
|
+
|
590
|
+
|
591
|
+
.entry-footer .edit-link {
|
592
|
+
|
593
|
+
display: table-cell;
|
594
|
+
|
595
|
+
text-align: right;
|
596
|
+
|
597
|
+
vertical-align: middle;
|
598
|
+
|
599
|
+
}
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
.entry-footer .edit-link a.post-edit-link {
|
604
|
+
|
605
|
+
margin-top: 0;
|
606
|
+
|
607
|
+
margin-left: 1em;
|
608
|
+
|
609
|
+
}
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
```
|
1
single.php、content.phpを追記しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -151,3 +151,225 @@
|
|
151
151
|
get_footer();
|
152
152
|
|
153
153
|
```
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
```
|
162
|
+
|
163
|
+
//個別投稿のテーマファイル:single.phpの内容
|
164
|
+
|
165
|
+
<?php
|
166
|
+
|
167
|
+
get_header(); ?>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<div class="wrap">
|
172
|
+
|
173
|
+
<div id="primary" class="content-area">
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
<main id="main" class="site-main" role="main">
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<?php
|
182
|
+
|
183
|
+
// Start the Loop.
|
184
|
+
|
185
|
+
while ( have_posts() ) :
|
186
|
+
|
187
|
+
the_post();
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
get_template_part( 'template-parts/post/content', get_post_format() );
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
//いいねボタン
|
196
|
+
|
197
|
+
if(function_exists('the_ratings')) { the_ratings(); }
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
// If comments are open or we have at least one comment, load up the comment template.
|
202
|
+
|
203
|
+
if ( comments_open() || get_comments_number() ) :
|
204
|
+
|
205
|
+
comments_template();
|
206
|
+
|
207
|
+
endif;
|
208
|
+
|
209
|
+
endwhile; // End the loop.
|
210
|
+
|
211
|
+
?>
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
</main><!-- #main -->
|
216
|
+
|
217
|
+
<a href= "http://onetokyo.fem.jp/" >一覧に戻る</a>
|
218
|
+
|
219
|
+
</div><!-- #primary -->
|
220
|
+
|
221
|
+
<!-- <?php get_sidebar(); ?>
|
222
|
+
|
223
|
+
</div><!-- .wrap -->
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
<?php
|
228
|
+
|
229
|
+
get_footer();
|
230
|
+
|
231
|
+
```
|
232
|
+
|
233
|
+
|
234
|
+
|
235
|
+
```
|
236
|
+
|
237
|
+
//個別投稿のテンプレートファイル:content.php (template-parts/post/content.php)
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
<?php
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
246
|
+
|
247
|
+
<?php
|
248
|
+
|
249
|
+
if ( is_sticky() && is_home() ) :
|
250
|
+
|
251
|
+
echo twentyseventeen_get_svg( array( 'icon' => 'thumb-tack' ) );
|
252
|
+
|
253
|
+
endif;
|
254
|
+
|
255
|
+
?>
|
256
|
+
|
257
|
+
<header class="entry-header">
|
258
|
+
|
259
|
+
<?php
|
260
|
+
|
261
|
+
if ( 'post' === get_post_type() ) {
|
262
|
+
|
263
|
+
echo '<div class="entry-meta">';
|
264
|
+
|
265
|
+
if ( is_single() ) {
|
266
|
+
|
267
|
+
twentyseventeen_posted_on();
|
268
|
+
|
269
|
+
} else {
|
270
|
+
|
271
|
+
echo twentyseventeen_time_link();
|
272
|
+
|
273
|
+
twentyseventeen_edit_link();
|
274
|
+
|
275
|
+
};
|
276
|
+
|
277
|
+
echo '</div><!-- .entry-meta -->';
|
278
|
+
|
279
|
+
};
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
if ( is_single() ) {
|
284
|
+
|
285
|
+
the_title( '<h1 class="entry-title">', '</h1>' );
|
286
|
+
|
287
|
+
} elseif ( is_front_page() && is_home() ) {
|
288
|
+
|
289
|
+
the_title( '<h3 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h3>' );
|
290
|
+
|
291
|
+
} else {
|
292
|
+
|
293
|
+
the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
|
294
|
+
|
295
|
+
}
|
296
|
+
|
297
|
+
?>
|
298
|
+
|
299
|
+
</header><!-- .entry-header -->
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
<?php if ( '' !== get_the_post_thumbnail() && ! is_single() ) : ?>
|
304
|
+
|
305
|
+
<div class="post-thumbnail">
|
306
|
+
|
307
|
+
<a href="<?php the_permalink(); ?>">
|
308
|
+
|
309
|
+
<?php the_post_thumbnail( 'twentyseventeen-featured-image' ); ?>
|
310
|
+
|
311
|
+
</a>
|
312
|
+
|
313
|
+
</div><!-- .post-thumbnail -->
|
314
|
+
|
315
|
+
<?php endif; ?>
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
<div class="entry-content">
|
320
|
+
|
321
|
+
<?php
|
322
|
+
|
323
|
+
the_content(
|
324
|
+
|
325
|
+
sprintf(
|
326
|
+
|
327
|
+
/* translators: %s: Post title. */
|
328
|
+
|
329
|
+
__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ),
|
330
|
+
|
331
|
+
get_the_title()
|
332
|
+
|
333
|
+
)
|
334
|
+
|
335
|
+
);
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
wp_link_pages(
|
340
|
+
|
341
|
+
array(
|
342
|
+
|
343
|
+
'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ),
|
344
|
+
|
345
|
+
'after' => '</div>',
|
346
|
+
|
347
|
+
'link_before' => '<span class="page-number">',
|
348
|
+
|
349
|
+
'link_after' => '</span>',
|
350
|
+
|
351
|
+
)
|
352
|
+
|
353
|
+
);
|
354
|
+
|
355
|
+
?>
|
356
|
+
|
357
|
+
</div><!-- .entry-content -->
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
<?php
|
362
|
+
|
363
|
+
if ( is_single() ) {
|
364
|
+
|
365
|
+
twentyseventeen_entry_footer();
|
366
|
+
|
367
|
+
}
|
368
|
+
|
369
|
+
?>
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
</article><!-- #post-<?php the_ID(); ?> -->
|
374
|
+
|
375
|
+
```
|