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

質問編集履歴

2

コードの変更

2016/06/13 04:11

投稿

marshmallow
marshmallow

スコア33

title CHANGED
File without changes
body CHANGED
@@ -58,6 +58,7 @@
58
58
  上記のサイト様の
59
59
  index.htmlにWordpressの新着を表示する場合の部分の
60
60
 
61
+ ```
61
62
  <script src="http://www.google.com/jsapi" type="text/javascript"></script>
62
63
 
63
64
  <script type="text/javascript">
@@ -120,8 +121,10 @@
120
121
  </script>
121
122
 
122
123
  <p id="feed"></p>
124
+ ```
123
125
 
124
126
  の中の
127
+ ```
125
128
  container.innerHTML += '<div class=\"3col\"><p class=\"sub alt-font\">'
126
129
  + date
127
130
  + '</p><h3><a href="' + entry.link + '">'
@@ -130,6 +133,7 @@
130
133
  + '<p>'
131
134
  + entry.contentSnippet.substring(0,120)
132
135
  + '<br><a href="' + entry.link + '" class=\"link-text\">Read more</a></p><hr></div>';
136
+ ```
133
137
 
134
138
  の部分であるclass="3col"の中をcssを適応したいと思っています。
135
139
 

1

cssについて、phpについて

2016/06/13 04:11

投稿

marshmallow
marshmallow

スコア33

title CHANGED
File without changes
body CHANGED
@@ -47,4 +47,102 @@
47
47
  大変申し訳ありません。
48
48
 
49
49
  ご回答いただければ幸いです。
50
- よろしくお願いします。
50
+ よろしくお願いします。
51
+
52
+ 追記です。
53
+
54
+ ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
55
+
56
+ cssを変更したい部分ですが、
57
+ http://www.jiriki.co.jp/blog/wordpress/wordpress-indexhtml
58
+ 上記のサイト様の
59
+ index.htmlにWordpressの新着を表示する場合の部分の
60
+
61
+ <script src="http://www.google.com/jsapi" type="text/javascript"></script>
62
+
63
+ <script type="text/javascript">
64
+ google.load("feeds", "1"); //APIを読み込みます
65
+
66
+ function initialize(){
67
+
68
+ var feed = new google.feeds.Feed("http://www.jiriki.co.jp/blog/feed");
69
+ var noPhoto = ("<img src='img/logo-dark.png' />");
70
+
71
+ feed.setNumEntries(3);
72
+ feed.load(dispfeed);
73
+
74
+ function dispfeed(result){
75
+
76
+ if(!result.error){
77
+ var container = document.getElementById("feed");
78
+
79
+ for (var i = 0; i < result.feed.entries.length; i++) {
80
+
81
+ var entry = result.feed.entries[i];
82
+
83
+ var entryDate = new Date(entry.publishedDate);
84
+ var entryYear = entryDate.getYear();
85
+ if (entryYear < 2000){
86
+ entryYear += 1900;
87
+ }
88
+ var entryMonth = entryDate.getMonth() + 1;
89
+ if (entryMonth < 10) {
90
+ entryMonth = "0" + entryMonth;
91
+ }
92
+ var entryDay = entryDate.getDate();
93
+ if (entryDay < 10) {
94
+ entryDay = "0" + entryDay;
95
+ }
96
+ var date = entryYear + "/" + entryMonth + "/" + entryDay;
97
+
98
+ var entryImg = "";
99
+ var imgCheck = entry.content.match(/(src="http:)[\S]+((\.jpg)|(\.JPG)|(\.jpeg)|(\.JPEG)|(\.gif)|(\.GIF)|(\.png)|(\.PNG))/);
100
+ if(imgCheck){
101
+ entryImg += '<img ' + imgCheck[0] + '" width=\"200px\">';
102
+ } else {
103
+ entryImg += noPhoto;
104
+ }
105
+
106
+ container.innerHTML += '<div class=\"3col\"><p class=\"sub alt-font\">'
107
+ + date
108
+ + '</p><h3><a href="' + entry.link + '">'
109
+ + entry.title + '</a></h3>'
110
+ + entryImg
111
+ + '<p>'
112
+ + entry.contentSnippet.substring(0,120)
113
+ + '<br><a href="' + entry.link + '" class=\"link-text\">Read more</a></p><hr></div>';
114
+ }
115
+
116
+ }
117
+ }
118
+ }
119
+ google.setOnLoadCallback(initialize);
120
+ </script>
121
+
122
+ <p id="feed"></p>
123
+
124
+ の中の
125
+ container.innerHTML += '<div class=\"3col\"><p class=\"sub alt-font\">'
126
+ + date
127
+ + '</p><h3><a href="' + entry.link + '">'
128
+ + entry.title + '</a></h3>'
129
+ + entryImg
130
+ + '<p>'
131
+ + entry.contentSnippet.substring(0,120)
132
+ + '<br><a href="' + entry.link + '" class=\"link-text\">Read more</a></p><hr></div>';
133
+
134
+ の部分であるclass="3col"の中をcssを適応したいと思っています。
135
+
136
+ またPHPですが、
137
+
138
+ <?php
139
+ /*
140
+ Template Name: Top Page
141
+ */
142
+ readfile(ABSPATH . '/index.html');
143
+ ?>
144
+
145
+ になります。
146
+
147
+ 初心者で、情報がうまく伝えきれていないところがあり、
148
+ 申し訳ございません。