質問編集履歴

5

修正

2019/01/07 03:06

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -7,339 +7,3 @@
7
7
 
8
8
 
9
9
  今は、wp user frontend proで投稿フォームをAとBで作ってありまして、Aは通常のpostにきちんとフロントエンドからも投稿できているのですが、別に作った投稿タイプにはBを使用しても反映されません。
10
-
11
-
12
-
13
- ![イメージ説明](bc67636afd224f3e7af842a7656426c3.jpeg)
14
-
15
-
16
-
17
- 素人の説明で質問すらわかりにくく恐縮ではありますがどなたかご教授をいただけますと幸いです。
18
-
19
-
20
-
21
- ### 発生している問題
22
-
23
-
24
-
25
- ```
26
-
27
- 作成した投稿フォームのショートコードを貼り付けたページから投稿をしても反映されない
28
-
29
- →(追記)フロントエンドから投稿した後、投稿したページは真っ白なページで
30
-
31
- 何も表示されないのですが、
32
-
33
- (例:https://test.com/event/1054)
34
-
35
- だったとして
36
-
37
- (例:https://test.com/wp-admin/post.php?post=1054&action=edit)
38
-
39
- でアクセスすると、投稿編集ページにはいけました。
40
-
41
- 色々いじってみると、投稿編集ページにもあるイベントタグとイベント日設定を入れると
42
-
43
- 表示されることがわかりました。
44
-
45
- そうすると、wp user frontend pro上でのフォームのメタキーの設定なのでしょうか?
46
-
47
- ```
48
-
49
- 「投稿フォーム」の設定内容です
50
-
51
- ![イメージ説明](1bdc597e3c1cfaeeb834f89a725006b8.png)
52
-
53
- 投稿フォームのショートコードです
54
-
55
- [wpuf_form id="448"]
56
-
57
-
58
-
59
- wordpressの管理画面上の投稿画面です
60
-
61
- ![イメージ説明](0bc5fb88eafa95ad90a651c2e70d4c24.png)
62
-
63
-
64
-
65
- 不必要かもなのですが、反映したいphpです
66
-
67
- <?php
68
-
69
- $dp_options = get_design_plus_options();
70
-
71
-
72
-
73
- $event_label = $dp_options['event_slug'] ? $dp_options['event_breadcrumb'] : __( 'Event', 'tcd-w' );
74
-
75
-
76
-
77
- get_header();
78
-
79
- ?>
80
-
81
- <main class="l-main">
82
-
83
- <?php get_template_part( 'template-parts/breadcrumb' ); ?>
84
-
85
- <?php
86
-
87
- if ( have_posts() ) :
88
-
89
- while ( have_posts() ) :
90
-
91
- the_post();
92
-
93
- $timestamp = strtotime( $post->event_date );
94
-
95
- $event_tags = get_the_terms( $post->ID, 'event_tag' );
96
-
97
- $previous_post = get_previous_post( true, '', 'event_tag' );
98
-
99
- $next_post = get_next_post( true, '', 'event_tag' );
100
-
101
- $args = array(
102
-
103
- 'post_type' => 'event',
104
-
105
- 'post_status' => 'publish',
106
-
107
- 'posts_per_page' => 9,
108
-
109
- 'orderby' => 'meta_value',
110
-
111
- 'meta_type' => 'DATE',
112
-
113
- 'order' => 'ASC',
114
-
115
- 'meta_key' => 'event_date',
116
-
117
- 'meta_value' => date( 'Y-m-d' ),
118
-
119
- 'meta_compare' =>'>=',
120
-
121
- 'tax_query' => array(
122
-
123
- array(
124
-
125
- 'taxonomy' => 'event_tag',
126
-
127
- 'field' => 'term_id',
128
-
129
- 'terms' => $event_tags[0]->term_id,
130
-
131
- )
132
-
133
- )
134
-
135
- );
136
-
137
- $the_query = new WP_Query( $args );
138
-
139
- ?>
140
-
141
- <article class="p-entry">
142
-
143
- <header class="p-entry__header02">
144
-
145
- <div class="p-entry__header02-inner l-inner">
146
-
147
- <div class="p-entry__header02-upper p-entry__header02-upper--square">
148
-
149
- <time class="p-date" datetime="<?php echo esc_attr( $post->event_date ); ?>"><?php echo strtoupper( date( 'M', $timestamp ) ); ?><span class="p-date__day"><?php echo date( 'd', $timestamp ); ?></span><?php echo date( 'Y', $timestamp ); ?></time>
150
-
151
- </div>
152
-
153
- <div class="p-entry__header02-lower">
154
-
155
- <h1 class="p-entry__header02-title"><?php the_title(); ?></h1>
156
-
157
- </div>
158
-
159
- </div>
160
-
161
- </header>
162
-
163
- <div class="p-entry__body p-entry__body--sm l-inner">
164
-
165
- <?php if ( $post->slider_img1 ) : ?>
166
-
167
- <div class="js-slider p-slider">
168
-
169
- <a class="p-slider__cat p-event-cat p-event-cat--<?php echo esc_attr( $event_tags[0]->term_id ); ?>" href="<?php echo get_term_link( $event_tags[0] ); ?>"><?php echo esc_html( $event_tags[0]->name ); ?></a>
170
-
171
- <?php
172
-
173
- for ( $i = 1; $i <= 3; $i++ ) :
174
-
175
- if ( ! get_post_meta( $post->ID, 'slider_img' . $i, true ) ) break;
176
-
177
- ?>
178
-
179
- <div class="p-slider__item">
180
-
181
- <?php echo wp_get_attachment_image( get_post_meta( $post->ID, 'slider_img' . $i, true ), 'full' ); ?>
182
-
183
- </div>
184
-
185
- <?php endfor; ?>
186
-
187
- </div>
188
-
189
- <?php endif; ?>
190
-
191
- <?php
192
-
193
- the_content();
194
-
195
- if ( ! post_password_required() ) {
196
-
197
- wp_link_pages( array(
198
-
199
- 'before' => '<div class="p-page-links">',
200
-
201
- 'after' => '</div>',
202
-
203
- 'link_before' => '<span>',
204
-
205
- 'link_after' => '</span>'
206
-
207
- ) );
208
-
209
- }
210
-
211
- ?>
212
-
213
- </div>
214
-
215
- </article>
216
-
217
- <?php
218
-
219
- endwhile;
220
-
221
- endif;
222
-
223
- ?>
224
-
225
- <div class="l-inner u-center">
226
-
227
- <?php if ( $dp_options['event_show_sns'] ) { get_template_part( 'template-parts/sns-btn-btm' ); } ?>
228
-
229
- </div>
230
-
231
- <div class="l-inner">
232
-
233
- <?php if ( $options['event_show_next_post'] && ( $previous_post || $next_post ) ) : ?>
234
-
235
- <ul class="p-nav02">
236
-
237
- <?php if ( $previous_post ) : ?>
238
-
239
- <li class="p-nav02__item">
240
-
241
- <a href="<?php echo esc_url( get_permalink( $previous_post->ID ) ); ?>"><?php _e( 'Previous event', 'tcd-w' ); ?></a>
242
-
243
- </li>
244
-
245
- <?php endif; ?>
246
-
247
- <?php if ( $next_post ) : ?>
248
-
249
- <li class="p-nav02__item">
250
-
251
- <a href="<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>"><?php _e( 'Next event', 'tcd-w' ); ?></a>
252
-
253
- </li>
254
-
255
- <?php endif; ?>
256
-
257
- </ul>
258
-
259
- <?php endif; ?>
260
-
261
- <?php if ( $dp_options['display_upcoming_event'] ) : ?>
262
-
263
- <section class="p-upcoming-event">
264
-
265
- <div class="p-headline02">
266
-
267
- <h2 class="p-headline02__title"><?php echo esc_html( $dp_options['upcoming_event_title'] ); ?></h2>
268
-
269
- <p class="p-headline02__sub"><?php echo esc_html( $dp_options['upcoming_event_sub'] ); ?><?php if ( $event_tags[0] ) { echo ' | ' . esc_html( $event_tags[0]->name ); } ?></p>
270
-
271
- </div>
272
-
273
- <div class="p-event-list">
274
-
275
- <?php
276
-
277
- if ( $the_query->have_posts() ) :
278
-
279
- while ( $the_query->have_posts() ) :
280
-
281
- $the_query->the_post();
282
-
283
- $timestamp = strtotime( $post->event_date );
284
-
285
- ?>
286
-
287
- <article class="p-event-list__item p-article07 is-active">
288
-
289
- <a class="p-hover-effect--<?php echo esc_attr( $dp_options['hover_type'] ); ?> p-article07__round" href="<?php the_permalink(); ?>">
290
-
291
- <div class="p-article07__img">
292
-
293
- <?php
294
-
295
- if ( has_post_thumbnail() ) {
296
-
297
- the_post_thumbnail( 'size6' );
298
-
299
- } else {
300
-
301
- echo '<img src="' . get_template_directory_uri() . '/assets/images/740x500.gif" alt="">' . "\n";
302
-
303
- }
304
-
305
- ?>
306
-
307
- </div>
308
-
309
- <time class="p-article07__date p-date" datetime="<?php echo esc_attr( $post->event_date ); ?>"><?php echo strtoupper( date( 'M', $timestamp ) ); ?><span class="p-date__day"><?php echo date( 'd', $timestamp ); ?></span><?php echo date( 'Y', $timestamp ); ?></time>
310
-
311
- </a>
312
-
313
- <h3 class="p-article07__title">
314
-
315
- <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php echo is_mobile() ? wp_trim_words( get_the_title(), 35, '...' ) : wp_trim_words( get_the_title(), 38, '...' ); ?></a>
316
-
317
- </h3>
318
-
319
- </article>
320
-
321
- <?php
322
-
323
- endwhile;
324
-
325
- wp_reset_postdata();
326
-
327
- else :
328
-
329
- echo '<p>' . sprintf( __( 'There is no upcoming %s.', 'tcd-w' ), esc_html( $event_label ) ) . '</p>' . "\n";
330
-
331
- endif;
332
-
333
- ?>
334
-
335
- </div>
336
-
337
- </section>
338
-
339
- <?php endif; ?>
340
-
341
- </div>
342
-
343
- </main>
344
-
345
- <?php get_footer(); ?>

4

発生している問題を追記しました

2019/01/07 03:06

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -24,7 +24,25 @@
24
24
 
25
25
  ```
26
26
 
27
- 作成した投稿フォームのショートコードを貼り付けたページから投稿をしても反映されない→(追記)フロントエンドから投稿した後、投稿したページは真っ白なページで何も表示されないのですが、(例:https://test.com/event/1054)だったとして(例:https://test.com/wp-admin/post.php?post=1054&action=edit)でアクセスすると、投稿編集ページにはいけました。色々いじってみると、投稿編集ページにもあるイベントタグとイベント日設定を入れると表示されることがわかりました。そうすると、wp user frontend pro上でのフォームのメタキーの設定なのでしょうか?
27
+ 作成した投稿フォームのショートコードを貼り付けたページから投稿をしても反映されない
28
+
29
+ →(追記)フロントエンドから投稿した後、投稿したページは真っ白なページで
30
+
31
+ 何も表示されないのですが、
32
+
33
+ (例:https://test.com/event/1054)
34
+
35
+ だったとして
36
+
37
+ (例:https://test.com/wp-admin/post.php?post=1054&action=edit)
38
+
39
+ でアクセスすると、投稿編集ページにはいけました。
40
+
41
+ 色々いじってみると、投稿編集ページにもあるイベントタグとイベント日設定を入れると
42
+
43
+ 表示されることがわかりました。
44
+
45
+ そうすると、wp user frontend pro上でのフォームのメタキーの設定なのでしょうか?
28
46
 
29
47
  ```
30
48
 

3

発生している問題を追記しました

2019/01/04 06:46

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  ```
26
26
 
27
- 作成した投稿フォームのショートコードを貼り付けたページから投稿をしても反映されない
27
+ 作成した投稿フォームのショートコードを貼り付けたページから投稿をしても反映されない→(追記)フロントエンドから投稿した後、投稿したページは真っ白なページで何も表示されないのですが、(例:https://test.com/event/1054)だったとして(例:https://test.com/wp-admin/post.php?post=1054&action=edit)でアクセスすると、投稿編集ページにはいけました。色々いじってみると、投稿編集ページにもあるイベントタグとイベント日設定を入れると表示されることがわかりました。そうすると、wp user frontend pro上でのフォームのメタキーの設定なのでしょうか?
28
28
 
29
29
  ```
30
30
 

2

wordpressの管理画面上の投稿画面を追加しました

2019/01/04 06:44

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -38,6 +38,12 @@
38
38
 
39
39
 
40
40
 
41
+ wordpressの管理画面上の投稿画面です
42
+
43
+ ![イメージ説明](0bc5fb88eafa95ad90a651c2e70d4c24.png)
44
+
45
+
46
+
41
47
  不必要かもなのですが、反映したいphpです
42
48
 
43
49
  <?php

1

「投稿フォーム」の設定内容と「投稿フォームのショートコード」を追記致しました

2019/01/04 06:31

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -27,3 +27,295 @@
27
27
  作成した投稿フォームのショートコードを貼り付けたページから投稿をしても反映されない
28
28
 
29
29
  ```
30
+
31
+ 「投稿フォーム」の設定内容です
32
+
33
+ ![イメージ説明](1bdc597e3c1cfaeeb834f89a725006b8.png)
34
+
35
+ 投稿フォームのショートコードです
36
+
37
+ [wpuf_form id="448"]
38
+
39
+
40
+
41
+ 不必要かもなのですが、反映したいphpです
42
+
43
+ <?php
44
+
45
+ $dp_options = get_design_plus_options();
46
+
47
+
48
+
49
+ $event_label = $dp_options['event_slug'] ? $dp_options['event_breadcrumb'] : __( 'Event', 'tcd-w' );
50
+
51
+
52
+
53
+ get_header();
54
+
55
+ ?>
56
+
57
+ <main class="l-main">
58
+
59
+ <?php get_template_part( 'template-parts/breadcrumb' ); ?>
60
+
61
+ <?php
62
+
63
+ if ( have_posts() ) :
64
+
65
+ while ( have_posts() ) :
66
+
67
+ the_post();
68
+
69
+ $timestamp = strtotime( $post->event_date );
70
+
71
+ $event_tags = get_the_terms( $post->ID, 'event_tag' );
72
+
73
+ $previous_post = get_previous_post( true, '', 'event_tag' );
74
+
75
+ $next_post = get_next_post( true, '', 'event_tag' );
76
+
77
+ $args = array(
78
+
79
+ 'post_type' => 'event',
80
+
81
+ 'post_status' => 'publish',
82
+
83
+ 'posts_per_page' => 9,
84
+
85
+ 'orderby' => 'meta_value',
86
+
87
+ 'meta_type' => 'DATE',
88
+
89
+ 'order' => 'ASC',
90
+
91
+ 'meta_key' => 'event_date',
92
+
93
+ 'meta_value' => date( 'Y-m-d' ),
94
+
95
+ 'meta_compare' =>'>=',
96
+
97
+ 'tax_query' => array(
98
+
99
+ array(
100
+
101
+ 'taxonomy' => 'event_tag',
102
+
103
+ 'field' => 'term_id',
104
+
105
+ 'terms' => $event_tags[0]->term_id,
106
+
107
+ )
108
+
109
+ )
110
+
111
+ );
112
+
113
+ $the_query = new WP_Query( $args );
114
+
115
+ ?>
116
+
117
+ <article class="p-entry">
118
+
119
+ <header class="p-entry__header02">
120
+
121
+ <div class="p-entry__header02-inner l-inner">
122
+
123
+ <div class="p-entry__header02-upper p-entry__header02-upper--square">
124
+
125
+ <time class="p-date" datetime="<?php echo esc_attr( $post->event_date ); ?>"><?php echo strtoupper( date( 'M', $timestamp ) ); ?><span class="p-date__day"><?php echo date( 'd', $timestamp ); ?></span><?php echo date( 'Y', $timestamp ); ?></time>
126
+
127
+ </div>
128
+
129
+ <div class="p-entry__header02-lower">
130
+
131
+ <h1 class="p-entry__header02-title"><?php the_title(); ?></h1>
132
+
133
+ </div>
134
+
135
+ </div>
136
+
137
+ </header>
138
+
139
+ <div class="p-entry__body p-entry__body--sm l-inner">
140
+
141
+ <?php if ( $post->slider_img1 ) : ?>
142
+
143
+ <div class="js-slider p-slider">
144
+
145
+ <a class="p-slider__cat p-event-cat p-event-cat--<?php echo esc_attr( $event_tags[0]->term_id ); ?>" href="<?php echo get_term_link( $event_tags[0] ); ?>"><?php echo esc_html( $event_tags[0]->name ); ?></a>
146
+
147
+ <?php
148
+
149
+ for ( $i = 1; $i <= 3; $i++ ) :
150
+
151
+ if ( ! get_post_meta( $post->ID, 'slider_img' . $i, true ) ) break;
152
+
153
+ ?>
154
+
155
+ <div class="p-slider__item">
156
+
157
+ <?php echo wp_get_attachment_image( get_post_meta( $post->ID, 'slider_img' . $i, true ), 'full' ); ?>
158
+
159
+ </div>
160
+
161
+ <?php endfor; ?>
162
+
163
+ </div>
164
+
165
+ <?php endif; ?>
166
+
167
+ <?php
168
+
169
+ the_content();
170
+
171
+ if ( ! post_password_required() ) {
172
+
173
+ wp_link_pages( array(
174
+
175
+ 'before' => '<div class="p-page-links">',
176
+
177
+ 'after' => '</div>',
178
+
179
+ 'link_before' => '<span>',
180
+
181
+ 'link_after' => '</span>'
182
+
183
+ ) );
184
+
185
+ }
186
+
187
+ ?>
188
+
189
+ </div>
190
+
191
+ </article>
192
+
193
+ <?php
194
+
195
+ endwhile;
196
+
197
+ endif;
198
+
199
+ ?>
200
+
201
+ <div class="l-inner u-center">
202
+
203
+ <?php if ( $dp_options['event_show_sns'] ) { get_template_part( 'template-parts/sns-btn-btm' ); } ?>
204
+
205
+ </div>
206
+
207
+ <div class="l-inner">
208
+
209
+ <?php if ( $options['event_show_next_post'] && ( $previous_post || $next_post ) ) : ?>
210
+
211
+ <ul class="p-nav02">
212
+
213
+ <?php if ( $previous_post ) : ?>
214
+
215
+ <li class="p-nav02__item">
216
+
217
+ <a href="<?php echo esc_url( get_permalink( $previous_post->ID ) ); ?>"><?php _e( 'Previous event', 'tcd-w' ); ?></a>
218
+
219
+ </li>
220
+
221
+ <?php endif; ?>
222
+
223
+ <?php if ( $next_post ) : ?>
224
+
225
+ <li class="p-nav02__item">
226
+
227
+ <a href="<?php echo esc_url( get_permalink( $next_post->ID ) ); ?>"><?php _e( 'Next event', 'tcd-w' ); ?></a>
228
+
229
+ </li>
230
+
231
+ <?php endif; ?>
232
+
233
+ </ul>
234
+
235
+ <?php endif; ?>
236
+
237
+ <?php if ( $dp_options['display_upcoming_event'] ) : ?>
238
+
239
+ <section class="p-upcoming-event">
240
+
241
+ <div class="p-headline02">
242
+
243
+ <h2 class="p-headline02__title"><?php echo esc_html( $dp_options['upcoming_event_title'] ); ?></h2>
244
+
245
+ <p class="p-headline02__sub"><?php echo esc_html( $dp_options['upcoming_event_sub'] ); ?><?php if ( $event_tags[0] ) { echo ' | ' . esc_html( $event_tags[0]->name ); } ?></p>
246
+
247
+ </div>
248
+
249
+ <div class="p-event-list">
250
+
251
+ <?php
252
+
253
+ if ( $the_query->have_posts() ) :
254
+
255
+ while ( $the_query->have_posts() ) :
256
+
257
+ $the_query->the_post();
258
+
259
+ $timestamp = strtotime( $post->event_date );
260
+
261
+ ?>
262
+
263
+ <article class="p-event-list__item p-article07 is-active">
264
+
265
+ <a class="p-hover-effect--<?php echo esc_attr( $dp_options['hover_type'] ); ?> p-article07__round" href="<?php the_permalink(); ?>">
266
+
267
+ <div class="p-article07__img">
268
+
269
+ <?php
270
+
271
+ if ( has_post_thumbnail() ) {
272
+
273
+ the_post_thumbnail( 'size6' );
274
+
275
+ } else {
276
+
277
+ echo '<img src="' . get_template_directory_uri() . '/assets/images/740x500.gif" alt="">' . "\n";
278
+
279
+ }
280
+
281
+ ?>
282
+
283
+ </div>
284
+
285
+ <time class="p-article07__date p-date" datetime="<?php echo esc_attr( $post->event_date ); ?>"><?php echo strtoupper( date( 'M', $timestamp ) ); ?><span class="p-date__day"><?php echo date( 'd', $timestamp ); ?></span><?php echo date( 'Y', $timestamp ); ?></time>
286
+
287
+ </a>
288
+
289
+ <h3 class="p-article07__title">
290
+
291
+ <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php echo is_mobile() ? wp_trim_words( get_the_title(), 35, '...' ) : wp_trim_words( get_the_title(), 38, '...' ); ?></a>
292
+
293
+ </h3>
294
+
295
+ </article>
296
+
297
+ <?php
298
+
299
+ endwhile;
300
+
301
+ wp_reset_postdata();
302
+
303
+ else :
304
+
305
+ echo '<p>' . sprintf( __( 'There is no upcoming %s.', 'tcd-w' ), esc_html( $event_label ) ) . '</p>' . "\n";
306
+
307
+ endif;
308
+
309
+ ?>
310
+
311
+ </div>
312
+
313
+ </section>
314
+
315
+ <?php endif; ?>
316
+
317
+ </div>
318
+
319
+ </main>
320
+
321
+ <?php get_footer(); ?>