質問編集履歴

2

具体的にソースコードを追加しました

2017/09/27 14:32

投稿

gomatan1258
gomatan1258

スコア67

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,9 @@
4
4
 
5
5
 
6
6
 
7
- ```index.php
7
+ index.php
8
+
9
+ ```php
8
10
 
9
11
  <?php get_header(); ?>
10
12
 
@@ -112,6 +114,692 @@
112
114
 
113
115
  ```
114
116
 
115
-
117
+ header.php
118
+
116
-
119
+ ```php
120
+
121
+ <!DOCTYPE html>
122
+
123
+ <html lang="ja">
124
+
125
+ <head>
126
+
127
+ <meta charset="UTF-8">
128
+
129
+ <title><?php wp_title('|', true, 'right'); bloginfo('name'); ?></title>
130
+
131
+ <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.18.1/build/cssreset/cssreset-min.css">
132
+
133
+ <link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_uri(); ?>">
134
+
135
+ <?php wp_head(); ?>
136
+
137
+ </head>
138
+
139
+ <body>
140
+
141
+ <?php if(is_front_page()) { if (get_header_image() !='') { ?>
142
+
143
+ <div id="main_image">
144
+
145
+ <img src="<?php header_image(); ?>" alt="" title="" />
146
+
147
+ </div>
148
+
149
+ <?php }; }; ?>
150
+
117
- となっています。ほぼドットインストールの画像を元に作りました。(追記)自作です。まだ分らないことだらけで申し訳ございません。
151
+ <div id="header" class="container">
152
+
153
+ <h1><a href="<?php echo home_url('/'); ?>"><?php bloginfo('name');?></a></h1>
154
+
155
+ <div class="wrapper"><?php wp_nav_menu(); ?></div>
156
+
157
+ </div><!--/header-->
158
+
159
+ ```
160
+
161
+
162
+
163
+ footer.php
164
+
165
+ ```php
166
+
167
+ <div id="footer" class="container">
168
+
169
+ Copyright 2017<?php if(date("Y")!=2017) echo date("-Y"); ?> All right reserved, gomatan1258
170
+
171
+ </div><!--/footer-->
172
+
173
+ <?php wp_footer(); ?>
174
+
175
+
176
+
177
+ </body>
178
+
179
+ </html>
180
+
181
+ ```
182
+
183
+ sidebar.php
184
+
185
+ ```php
186
+
187
+ <div id="sidebar">
188
+
189
+ <?php dynamic_sidebar(); ?>
190
+
191
+ </div><!--/sidebar-->
192
+
193
+ ```
194
+
195
+
196
+
197
+ page.php
198
+
199
+ ```php
200
+
201
+ <?php get_header(); ?>
202
+
203
+ <div id="main" class="container">
204
+
205
+ <div id="posts">
206
+
207
+
208
+
209
+ <?php if(have_posts()):
210
+
211
+ while(have_posts()):
212
+
213
+ the_post();
214
+
215
+
216
+
217
+ ?>
218
+
219
+ <div class="post">
220
+
221
+ <div class="post-header">
222
+
223
+ <h2>
224
+
225
+ <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
226
+
227
+ </h2>
228
+
229
+ </div>
230
+
231
+
232
+
233
+ <div class="post-content">
234
+
235
+ <?php the_content(); ?>
236
+
237
+ <p>page.php</p>
238
+
239
+ </div>
240
+
241
+ </div>
242
+
243
+
244
+
245
+ <?php endwhile;
246
+
247
+ else:
248
+
249
+ ?>
250
+
251
+
252
+
253
+ <p>ページはありません!</p>
254
+
255
+
256
+
257
+ <?php endif;
258
+
259
+ ?>
260
+
261
+
262
+
263
+ </div><!--/posts-->
264
+
265
+ <?php get_sidebar(); ?>
266
+
267
+ </div><!--/main -->
268
+
269
+ <?php get_footer(); ?>
270
+
271
+ ```
272
+
273
+
274
+
275
+ single.php
276
+
277
+ ```php
278
+
279
+ <?php get_header(); ?>
280
+
281
+ <div id="main" class="container">
282
+
283
+ <div id="posts">
284
+
285
+
286
+
287
+ <?php if(have_posts()):
288
+
289
+ while(have_posts()):
290
+
291
+ the_post();
292
+
293
+
294
+
295
+ ?>
296
+
297
+ <div class="post">
298
+
299
+ <div class="post-header">
300
+
301
+ <h2>
302
+
303
+ <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
304
+
305
+ </h2>
306
+
307
+ </div>
308
+
309
+ <div class="post-meta">
310
+
311
+ <?php echo get_the_date(); ?> 【<?php the_category(', ') ?>】
312
+
313
+ </div>
314
+
315
+ <div class="post-content">
316
+
317
+ <?php the_content(); ?>
318
+
319
+ <P>single.php</P>
320
+
321
+ </div>
322
+
323
+ </div>
324
+
325
+
326
+
327
+ <div class="navigation">
328
+
329
+ <div class="prev"><?php previous_post_link(); ?></div>
330
+
331
+ <div class="next"><?php next_post_link(); ?></div>
332
+
333
+ </div>
334
+
335
+
336
+
337
+ <?php endwhile;
338
+
339
+ else:
340
+
341
+ ?>
342
+
343
+
344
+
345
+ <p>記事はありません!</p>
346
+
347
+
348
+
349
+ <?php endif;
350
+
351
+ ?>
352
+
353
+
354
+
355
+ </div><!--/posts-->
356
+
357
+ <?php get_sidebar(); ?>
358
+
359
+ </div><!--/main -->
360
+
361
+ <?php get_footer(); ?>
362
+
363
+ ```
364
+
365
+ functions.php
366
+
367
+ ```php
368
+
369
+ <?php
370
+
371
+
372
+
373
+ add_theme_support( 'custom-header' );
374
+
375
+
376
+
377
+ add_theme_support('menus');
378
+
379
+
380
+
381
+ register_sidebar(
382
+
383
+ array(
384
+
385
+ before_widget => '<div class="widget">',
386
+
387
+ after_widget => '</div>',
388
+
389
+ before_title => '<h3>',
390
+
391
+ after_title => '</h3>',
392
+
393
+ )
394
+
395
+ );
396
+
397
+
398
+
399
+ add_theme_support('post-thumbnails');
400
+
401
+
402
+
403
+ $cssdir = get_stylesheet_directory_uri();
404
+
405
+ wp_enqueue_script( 'theme-script', $cssdir.'/script.php', array('jquery'));
406
+
407
+
408
+
409
+
410
+
411
+ ?>
412
+
413
+ ```
414
+
415
+
416
+
417
+ style.css
418
+
419
+ ```css
420
+
421
+ /*
422
+
423
+ Theme Name: gomatan1258
424
+
425
+ Theme URI: http://localhost/
426
+
427
+ Author: ????
428
+
429
+ Author URI: http://localhost/
430
+
431
+ Description: gomatan1258
432
+
433
+ Version: 1.0
434
+
435
+ */
436
+
437
+
438
+
439
+ body {
440
+
441
+ font-size: 14px;
442
+
443
+ font-family: Arial, Verdana;
444
+
445
+ }
446
+
447
+
448
+
449
+ a {
450
+
451
+ text-decoration: none;
452
+
453
+ }
454
+
455
+
456
+
457
+ p {
458
+
459
+ padding-bottom: 14px;
460
+
461
+ margin: 0;
462
+
463
+ line-heihgt: 1.8;
464
+
465
+ }
466
+
467
+
468
+
469
+ .container {
470
+
471
+ width: 100%;
472
+
473
+ overflow: hidden;
474
+
475
+ }
476
+
477
+
478
+
479
+ #header {
480
+
481
+ width: 100%;
482
+
483
+ text-align: center;
484
+
485
+ }
486
+
487
+
488
+
489
+ .wrapper {
490
+
491
+ background-color: skyblue;
492
+
493
+ margin: 0 auto;
494
+
495
+ height: 50px;
496
+
497
+ display: table;
498
+
499
+ margin-bottom: 200px;
500
+
501
+ }
502
+
503
+
504
+
505
+ #main_image {
506
+
507
+ width: 100%;
508
+
509
+ height: auto;
510
+
511
+ text-align: center;
512
+
513
+ }
514
+
515
+
516
+
517
+ #main_image img {
518
+
519
+
520
+
521
+ }
522
+
523
+
524
+
525
+ h1 {
526
+
527
+ font-weight: bold;
528
+
529
+ font-size: 18px;
530
+
531
+ padding: 15px 0;
532
+
533
+ }
534
+
535
+
536
+
537
+ .menu {
538
+
539
+ font-size: 12px;
540
+
541
+ list-style: none;
542
+
543
+ padding: 5px;
544
+
545
+ z-index: 1;
546
+
547
+ }
548
+
549
+
550
+
551
+ .menu li {
552
+
553
+ position: relative;
554
+
555
+ background: skyblue;
556
+
557
+ float: left;
558
+
559
+ width: 148px;
560
+
561
+ border-right: 2px #fff solid;
562
+
563
+ text-align: center;
564
+
565
+ }
566
+
567
+
568
+
569
+ .menu .sub-menu {
570
+
571
+ display: none;
572
+
573
+ position: absolute;
574
+
575
+ top: 32px;
576
+
577
+ left: 10px;
578
+
579
+ z-index: 2;
580
+
581
+ }
582
+
583
+
584
+
585
+ .menu .sub-menu li {
586
+
587
+ background-color: black;
588
+
589
+ }
590
+
591
+
592
+
593
+ .menu .sub-menu li a {
594
+
595
+ color: white;
596
+
597
+ }
598
+
599
+
600
+
601
+ .menu a {
602
+
603
+ padding: 10px 0;
604
+
605
+ color: black;
606
+
607
+ display: block;
608
+
609
+ }
610
+
611
+
612
+
613
+ .menu a:hover {
614
+
615
+ background: blue;
616
+
617
+ color: white;
618
+
619
+ }
620
+
621
+
622
+
623
+
624
+
625
+ /* posts */
626
+
627
+
628
+
629
+ #posts {
630
+
631
+ float: left;
632
+
633
+ width: 60%;
634
+
635
+ margin-left: 10%;
636
+
637
+ }
638
+
639
+
640
+
641
+ .post {
642
+
643
+ margin-bottom: 30px;
644
+
645
+ }
646
+
647
+
648
+
649
+ .post-header {
650
+
651
+ margin-bottom: 15px;
652
+
653
+ }
654
+
655
+
656
+
657
+ .post-header h2 {
658
+
659
+ font-size: 16px;
660
+
661
+ font-weight: bold;
662
+
663
+ }
664
+
665
+
666
+
667
+ .post-meta {
668
+
669
+ font-size: 12px;
670
+
671
+ padding: 7px 0;
672
+
673
+ color: #555;
674
+
675
+ }
676
+
677
+
678
+
679
+ .post-content {
680
+
681
+ overflow: hidden;
682
+
683
+ }
684
+
685
+
686
+
687
+ .post-image {
688
+
689
+ float: left;
690
+
691
+ width: 115px;
692
+
693
+ }
694
+
695
+
696
+
697
+ .post-body {
698
+
699
+ margin-left: 115px;
700
+
701
+ }
702
+
703
+ /* sidebar */
704
+
705
+
706
+
707
+ #sidebar {
708
+
709
+ float: right;
710
+
711
+ width: 30%;
712
+
713
+ }
714
+
715
+
716
+
717
+ .widget {
718
+
719
+ margin-bottom: 25px;
720
+
721
+ }
722
+
723
+
724
+
725
+ .widget h3 {
726
+
727
+ font-weight: bold;
728
+
729
+ margin-bottom: 7px;
730
+
731
+ }
732
+
733
+
734
+
735
+ .widget li {
736
+
737
+ line-height: 1.8;
738
+
739
+ }
740
+
741
+
742
+
743
+ /* navigation */
744
+
745
+
746
+
747
+ .navigation {
748
+
749
+ overflow: hidden;
750
+
751
+ padding: 10px 0;
752
+
753
+ font-size: 12px;
754
+
755
+ margin-bottom: 15px;
756
+
757
+ }
758
+
759
+
760
+
761
+ .prev {
762
+
763
+ float: left;
764
+
765
+ width: 200px;
766
+
767
+ }
768
+
769
+
770
+
771
+ .next {
772
+
773
+ float: right;
774
+
775
+ width: 200px;
776
+
777
+ text-align: right;
778
+
779
+ }
780
+
781
+
782
+
783
+ /* footer */
784
+
785
+
786
+
787
+ #footer {
788
+
789
+ padding:15px 0;
790
+
791
+ font-size: 12px;
792
+
793
+ color: #aaa;
794
+
795
+ border-top: 1px solid #ccc;
796
+
797
+ }
798
+
799
+
800
+
801
+ ```
802
+
803
+
804
+
805
+ です。なんか貼りすぎて本当に申し訳ないです。

1

質問に追記しました。

2017/09/27 14:32

投稿

gomatan1258
gomatan1258

スコア67

test CHANGED
File without changes
test CHANGED
@@ -114,4 +114,4 @@
114
114
 
115
115
 
116
116
 
117
- となっています。ほぼドットインストールの画像を元に作りました。まだ分らないことだらけで申し訳ございません。
117
+ となっています。ほぼドットインストールの画像を元に作りました。(追記)自作です。まだ分らないことだらけで申し訳ございません。