質問編集履歴

1

PHP書き換え

2016/02/24 02:52

投稿

J4CK1E
J4CK1E

スコア66

test CHANGED
File without changes
test CHANGED
@@ -46,12 +46,6 @@
46
46
 
47
47
  ```PHP
48
48
 
49
- <?php
50
-
51
-
52
-
53
-
54
-
55
49
  get_header(); ?>
56
50
 
57
51
 
@@ -64,160 +58,144 @@
64
58
 
65
59
 
66
60
 
67
- <?php
68
-
69
- $txt = get_field('product_name');
70
-
71
- if($txt){ ?>
72
-
73
- <h1 class="entry-title"> <? echo $txt; ?></h1>
74
-
75
- <? }
76
-
77
- ?>
78
-
79
-
80
-
81
- <div class="entry-content">
82
-
83
- <?php
84
-
85
- $txt = get_field('product_image');
86
-
87
- if($txt){ ?>
88
-
89
- <?php
90
-
91
- if ( function_exists( 'soliloquy' ) ) { soliloquy($txt); }
92
-
93
- } ?>
94
-
95
-
96
-
97
- <?php
98
-
99
- $txt = get_field('product_text');
100
-
101
- if($txt){ ?>
102
-
103
- <div style="word-wrap:break-word";>
104
-
105
- <h4><? echo $txt; ?></h4></div>
106
-
107
- <? }
108
-
109
- ?>
110
-
111
-
112
-
113
- <?php
114
-
115
- $txt = get_field('product_spec');
116
-
117
- if($txt){ ?>
118
-
119
- <p><? echo $txt; ?></p>
120
-
121
- <? }
122
-
123
- ?>
124
-
125
-
126
-
127
- <?php
128
-
129
- $txt = get_field('price');
130
-
131
- if($txt){ ?>
132
-
133
- <span style="font-size:40px; color:#FF0000;"> <? echo $txt; ?></span>
134
-
135
- <? }
136
-
137
- ?>
138
-
139
-
140
-
141
- <span style="color: #ee0000;">
142
-
143
- (税込)
144
-
145
- </span>
146
-
147
-
148
-
149
- <?php
150
-
151
- $radio = get_field('size_color');
152
-
153
- if(get_field(' size_color ') == " enable"){ ?>
154
-
155
- <form>
156
-
157
- <div style="margin:10px 0 90px;">
158
-
159
- <select name="select2" class="smt_pc_selector">
160
-
161
- <?php
162
-
163
- $txt = get_field('size_color_input');
164
-
165
- if($txt){ ?>
166
-
167
- <? echo $txt; ?>
168
-
169
- <? }
170
-
171
- ?>
172
-
173
- <br>
174
-
175
- <?php
176
-
177
- $select = get_field('sell');
178
-
179
- if($select){ ?>
180
-
181
- </select>
182
-
183
- <input class="<? echo $select; ?>" type="button" onclick="top.location.href=select2.value" style="position:absolute; margin:30px 0 0px -200px;">
184
-
185
- </div>
186
-
187
- </form>
188
-
189
- <? }
190
-
191
- ?>
192
-
193
- <? }
194
-
195
-
196
-
197
- if(get_field(' size_color ') == " disable"){ ?>
198
-
199
- <?php
200
-
201
- $txt = get_field('variation_off');
202
-
203
- $select = get_field('sell');
204
-
205
- if($txt){ ?>
206
-
207
- <a href="https://hogehoge.com/productid=
208
-
209
- <? echo $txt; ?>
210
-
211
- "><img src="http://hogehogepress.com/2015/09/<? echo $select ; ?>.png"></a>
212
-
213
- <? }
214
-
215
- ?>
216
-
217
- </div>
61
+ <?php
62
+
63
+ $txt = get_field('product_name');
64
+
65
+ if($txt){ ?> <h1 class="entry-title"> <?php echo $txt; ?> </h1>
66
+
67
+ <? }
68
+
69
+ ?>
70
+
71
+
72
+
73
+ <div class="entry-content">
74
+
75
+ <?php
76
+
77
+ $txt = get_field('product_image');
78
+
79
+ if($txt){ ?>
80
+
81
+ <?php
82
+
83
+ if ( function_exists( 'soliloquy' ) ) { soliloquy($txt); }
84
+
85
+ } ?>
86
+
87
+
88
+
89
+ <?php
90
+
91
+ $txt = get_field('product_text');
92
+
93
+ if($txt){ ?>
94
+
95
+ <div style="word-wrap:break-word";>
96
+
97
+ <h4><? echo $txt; ?></h4></div>
98
+
99
+ <? }
100
+
101
+ ?>
102
+
103
+
104
+
105
+ <?php
106
+
107
+ $txt = get_field('product_spec');
108
+
109
+ if($txt){ ?>
110
+
111
+ <p><? echo $txt; ?></p>
112
+
113
+ <? }
114
+
115
+ ?>
116
+
117
+
118
+
119
+ <?php
120
+
121
+ $txt = get_field('price');
122
+
123
+ if($txt){ ?>
124
+
125
+ <span style="font-size:40px; color:#FF0000;"> <? echo $txt; ?></span>
126
+
127
+ <? }
128
+
129
+ ?>
130
+
131
+
132
+
133
+ <span style="color: #ee0000;">
134
+
135
+ (税込)
136
+
137
+ </span>
138
+
139
+
140
+
141
+ <?php
142
+
143
+ $radio = get_field('size_color');
144
+
145
+ if(get_field(' size_color ') == "enable"){?>
146
+
147
+ <form>
148
+
149
+ <div class="sel" style="text-align: center; margin-top:10px;">
150
+
151
+ <select name="select2">
152
+
153
+ <?php
154
+
155
+ $txt = get_field('size_color_input');
156
+
157
+ if($txt){ echo $txt; }?>
158
+
159
+ <? echo $txt; ?>
160
+
161
+ </select>
162
+
163
+ <?php
164
+
165
+ $select = get_field('sell');
166
+
167
+ if($select){?>
168
+
169
+ <input class="<? echo $select; ?>" type="button" value="" onclick="top.location.href=select2.value">
170
+
171
+ }
172
+
173
+ }
174
+
175
+
176
+
177
+ <?php
178
+
179
+ if(get_field(' size_color ') == "disable"){?>
180
+
181
+ <?php
182
+
183
+ $txt = get_field('variation_off');
184
+
185
+ if($txt){ echo $txt; }
186
+
187
+ $select = get_field('sell');
188
+
189
+ if($select){ echo $select; }?>
190
+
191
+ <a href="https://hoge.com/p_id=<? echo $txt; ?>" class="<? echo $select; ?>">
218
192
 
219
193
  <?php endwhile; ?>
220
194
 
195
+
196
+
197
+
198
+
221
199
  </div><!-- #content -->
222
200
 
223
201
  </div><!-- #primary -->
@@ -270,6 +248,10 @@
270
248
 
271
249
 
272
250
 
251
+ $radioの前までですとしっかりと表示されます。しかし、
252
+
273
253
  こちらですと、endwhileの部分でエラーが出てしまい、動作確認もできず...
274
254
 
255
+ おそらく$radio以降、書き方が間違えているのではないかと思っています。
256
+
275
257
  お恥ずかしい話なのですが、どこが間違えているか、ご教示いただければと思います。