teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

2017/09/06 11:57

投稿

rin1
rin1

スコア7

title CHANGED
File without changes
body CHANGED
@@ -23,17 +23,7 @@
23
23
  <div>
24
24
  スポンサードリンク
25
25
  </div>
26
- <div>
26
+
27
- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
28
- <!-- バナー用テキスト -->
29
- <ins class="adsbygoogle"
30
- style="display:inline-block;width:728px;height:90px"
31
- data-ad-client="ca-pub-3177082317388295"
32
- data-ad-slot="6718938763"></ins>
33
- <script>
34
- (adsbygoogle = window.adsbygoogle || []).push({});
35
- </script>
36
- </div>
37
27
  <?php if( !is_front_page() ): ?>
38
28
  <?php if( !is_front_page() ): ?>
39
29
  <!--ぱんくず -->

1

page\.php追記しました

2017/09/06 11:57

投稿

rin1
rin1

スコア7

title CHANGED
File without changes
body CHANGED
@@ -13,4 +13,120 @@
13
13
  ###試したこと
14
14
 
15
15
 
16
- ###補足情報(言語/FW/ツール等のバージョンなど)
16
+ ###補足情報(言語/FW/ツール等のバージョンなど)
17
+ ```<?php get_header(); ?>
18
+
19
+ <div id="content" class="clearfix">
20
+ <div id="contentInner">
21
+ <div class="st-main">
22
+ <div class=”st-main”>
23
+ <div>
24
+ スポンサードリンク
25
+ </div>
26
+ <div>
27
+ <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
28
+ <!-- バナー用テキスト -->
29
+ <ins class="adsbygoogle"
30
+ style="display:inline-block;width:728px;height:90px"
31
+ data-ad-client="ca-pub-3177082317388295"
32
+ data-ad-slot="6718938763"></ins>
33
+ <script>
34
+ (adsbygoogle = window.adsbygoogle || []).push({});
35
+ </script>
36
+ </div>
37
+ <?php if( !is_front_page() ): ?>
38
+ <?php if( !is_front_page() ): ?>
39
+ <!--ぱんくず -->
40
+ <section id="breadcrumb">
41
+ <ol itemscope itemtype="http://schema.org/BreadcrumbList">
42
+ <li itemprop="itemListElement" itemscope
43
+ itemtype="http://schema.org/ListItem"><a href="<?php echo home_url(); ?>" itemprop="item"><span itemprop="name">HOME</span></a> > <meta itemprop="position" content="1" /></li>
44
+ <?php
45
+ $i = 2;
46
+ foreach ( array_reverse( get_post_ancestors( $post->ID ) ) as $parid ) { ?>
47
+
48
+ <li itemprop="itemListElement" itemscope
49
+ itemtype="http://schema.org/ListItem"><a href="<?php echo get_page_link( $parid ); ?>" title="<?php echo get_the_title(); ?>" itemprop="item"> <span itemprop="name"><?php echo get_page( $parid )->post_title; ?></span></a> > <meta itemprop="position" content="<?php echo $i; ?>" /></li>
50
+ <?php $i++; } ?>
51
+ </ol>
52
+ </section>
53
+ <!--/ ぱんくず -->
54
+ <?php endif; ?>
55
+
56
+ <div id="st-page" <?php post_class('post'); ?>>
57
+ <article>
58
+ <!--ループ開始 -->
59
+ <?php if (have_posts()) : while (have_posts()) :
60
+ the_post(); ?>
61
+
62
+ <?php if(!is_front_page()){ ?>
63
+ <h1 class="entry-title"><?php the_title(); //タイトル ?></h1>
64
+ <?php } ?>
65
+
66
+ <div class="mainbox">
67
+
68
+ <div class="entry-content">
69
+ <?php the_content(); //本文 ?>
70
+ </div>
71
+
72
+ <?php //ページ改
73
+ $defaults = array(
74
+ 'before' => '<p class="tuzukicenter"><span class="tuzuki">' . __( '', 'default' ),
75
+ 'after' => '</span></p>',
76
+ 'link_before' => '&gt;&ensp;',
77
+ 'link_after' => '&ensp;',
78
+ 'next_or_number' => 'next',
79
+ 'separator' => ' ',
80
+ 'nextpagelink' => __( '続きを読む', 'default' ),
81
+ 'previouspagelink' => __( '前のページへ', 'default' ),
82
+ 'pagelink' => '%',
83
+ 'echo' => 1
84
+ );
85
+ wp_link_pages( $defaults );
86
+ ?>
87
+
88
+ </div>
89
+
90
+ <?php if( is_front_page() ):
91
+ get_template_part( 'sns-top' ); //トップ用ソーシャルボタン読み込み
92
+ else:
93
+ get_template_part( 'sns' ); //ページ用ソーシャルボタン読み込み
94
+ endif; ?>
95
+
96
+ <div class="blogbox">
97
+ <p><span class="kdate">
98
+ <?php if ( get_the_date() != get_the_modified_date() ) : //更新がある場合 ?>
99
+ 投稿日:<?php echo esc_html( get_the_date() ); ?>
100
+ 更新日:<time class="updated" datetime="<?php echo esc_attr( get_the_modified_date( DATE_ISO8601 ) ); ?>"><?php echo esc_html( get_the_modified_date() ); ?></time>
101
+ <?php else: //更新がない場合 ?>
102
+ 投稿日:<time class="updated" datetime="<?php echo esc_attr( get_the_date( DATE_ISO8601 ) ); ?>"><?php echo esc_html( get_the_date() ); ?></time>
103
+ <?php endif; ?>
104
+ </span></p>
105
+ </div>
106
+
107
+ <p>執筆者:<?php the_author_posts_link(); ?></p>
108
+
109
+ <?php endwhile; else: ?>
110
+ <p>記事がありません</p>
111
+ <?php endif; ?>
112
+ <!--ループ終了 -->
113
+
114
+ </article>
115
+
116
+ <?php if ( comments_open() || get_comments_number() ) {
117
+ comments_template(); //コメント
118
+ } ?>
119
+
120
+ <?php get_template_part( 'newpost-page' ); //最近のエントリ ?>
121
+
122
+ </div>
123
+ <!--/post-->
124
+
125
+ </div><!-- /st-main -->
126
+ </div>
127
+ <!-- /#contentInner -->
128
+ <?php get_sidebar(); ?>
129
+ </div>
130
+ <!--/#content -->
131
+ <?php get_footer(); ?>
132
+ ```