質問編集履歴

5

修正

2020/09/16 04:45

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- タブパネルの機能を使ってページ送りの機能つけたんですが、全てのタブでページ送りすると他のお知らせのタグや、ブログのタグも連動して動きます。一覧のタブだけページ送りの機能をつけたいです。
1
+ タブパネルの機能を使ってページ送りの機能つけたんですが、全てのタブでページ送りすると他のお知らせのタグや、ブログのタグも連動して動きます。全てのタブページ送りの機能をつけたいです。
2
2
 
3
3
  ```php
4
4
 

4

コードを変えた

2020/09/16 04:45

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,10 +1,200 @@
1
+ タブパネルの機能を使ってページ送りの機能つけたんですが、全てのタブでページ送りすると他のお知らせのタグや、ブログのタグも連動して動きます。一覧のタブだけページ送りの機能をつけたいです。
2
+
3
+ ```php
4
+
5
+ <div id="NEWS">
6
+
7
+ <div class="NEWS-title">
8
+
9
+ <h1>news</h1>
10
+
11
+ </div>
12
+
13
+ <div class="tab-wrap">
14
+
15
+ <div class="tab-group">
16
+
17
+ <div class="tab is-active">全て</div>
18
+
19
+ <div class="tab">お知らせ</div>
20
+
21
+ <div class="tab">ブログ</div>
22
+
23
+ </div>
24
+
25
+ </div>
26
+
27
+ <div class="panel-group">
28
+
1
- タブパネルがいきなり機能しなくなリました。エラーの内容がわからず対策できませんでした。
29
+ <div class="panel is-show">
30
+
2
-
31
+ <?php
32
+
33
+ $paged = get_query_var('paged') ? get_query_var('paged') : 1 ;
34
+
3
- コードみにくくてすみません
35
+ $args = array(
36
+
4
-
37
+ 'post_type' => 'post',
38
+
39
+ 'category_name' => 'news,blog',
40
+
41
+ 'posts_per_page' => 3,
42
+
43
+ 'paged' => $paged
44
+
45
+ );
46
+
47
+ $the_query = new WP_Query( $args );
48
+
49
+ if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) :
50
+
51
+ $the_query->the_post();
52
+
53
+ ?>
54
+
55
+ <div class="left-post-date">
56
+
57
+ <?php echo get_the_date(); ?>
58
+
5
- 幅を広げるときちんと機能します。
59
+ </div>
60
+
6
-
61
+ <div class="left-post-item">
62
+
63
+ <?php the_category(); ?>
64
+
65
+ </div>
66
+
67
+ <a href="<?php the_permalink(); ?>" class="left-post-title">
68
+
69
+ <?php echo get_the_title(); ?></a>
70
+
71
+ <?php endwhile; ?>
72
+
73
+ <?php endif; ?>
74
+
75
+ <div class="nav-previous alignleft">
76
+
77
+ <?php if (get_previous_post()):?>
78
+
79
+ <?php next_posts_link( '<img src="'. get_template_directory_uri().'/img/競技.png" />' ); ?>
80
+
81
+ <?php endif; ?>
82
+
83
+ </div>
84
+
85
+ <div class="nav-next alignright">
86
+
87
+ <?php if (get_next_post()):?>
88
+
89
+ <?php previous_posts_link( '<img src="'. get_template_directory_uri().'/img/競技-2.png" />' ); ?></div>
90
+
91
+ <?php endif; ?>
92
+
93
+ </div>
94
+
95
+ <?php wp_reset_postdata(); ?>
96
+
97
+ <div class="panel">
98
+
99
+ <?php
100
+
7
- 回答よろしくお願いします。
101
+ $args = array(
102
+
103
+ 'post_type' => 'news',
104
+
105
+ 'category_name' => 'news',
106
+
107
+ 'posts_per_page' => 3,
108
+
109
+ 'paged' => $paged
110
+
111
+ );
112
+
113
+ $the_query = new WP_Query( $args );
114
+
115
+ if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) :
116
+
117
+ $the_query->the_post();
118
+
119
+ ?>
120
+
121
+ <div class="center-news-date">
122
+
123
+ <?php echo get_the_date(); ?>
124
+
125
+ </div>
126
+
127
+ <div class="center-news-item">
128
+
129
+ <?php the_category(); ?>
130
+
131
+ </div>
132
+
133
+ <a href="<?php the_permalink(); ?>" class="center-news-title">
134
+
135
+ <?php the_title(); ?></a>
136
+
137
+ <?php endwhile; ?>
138
+
139
+ <?php endif; ?>
140
+
141
+ <?php wp_reset_postdata(); ?>
142
+
143
+ </div>
144
+
145
+ <div class="panel">
146
+
147
+ <?php
148
+
149
+ $args = array(
150
+
151
+ 'post_type' => 'blog',
152
+
153
+ 'category_name' => 'blog',
154
+
155
+ 'posts_per_page' => 3,
156
+
157
+ );
158
+
159
+ $the_query = new WP_Query( $args );
160
+
161
+ if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) :
162
+
163
+ $the_query->the_post();
164
+
165
+ ?>
166
+
167
+ <div class="left-news-date">
168
+
169
+ <?php echo get_the_date(); ?>
170
+
171
+ </div>
172
+
173
+ <div class="left-news-item">
174
+
175
+ <?php the_category(); ?>
176
+
177
+ </div>
178
+
179
+ <a href="<?php the_permalink(); ?>" class="left-news-title">
180
+
181
+ <?php the_title(); ?></a>
182
+
183
+ <?php endwhile; ?>
184
+
185
+ <?php endif; ?>
186
+
187
+ <?php wp_reset_postdata(); ?>
188
+
189
+ </div>
190
+
191
+ </div>
192
+
193
+ </div>
194
+
195
+ </div>
196
+
197
+ ```
8
198
 
9
199
  ```js
10
200
 
@@ -22,284 +212,12 @@
22
212
 
23
213
  });
24
214
 
215
+ });
216
+
25
217
  ```
26
218
 
27
- ```css
219
+ 試したこと
28
-
29
- #NEWS{
220
+
30
-
31
- position: absolute;
32
-
33
- top: -5px;
34
-
35
- right: 20px;
36
-
37
- font-family: serif;
38
-
39
- width: 42%;
40
-
41
- }
42
-
43
- @media screen and (max-width: 1200px){
221
+ お知らせや、ブログの部分にページ送りの機能をつけると、お知らせの部分に書いてあったものが表示されなくなる。
44
-
45
- #NEWS{
222
+
46
-
47
- position: absolute;
48
-
49
- top: 400px;
50
-
51
- right: 0;
52
-
53
- left: 0;
54
-
55
- width: 55%;
56
-
57
- margin: auto;
58
-
59
- }
60
-
61
- }
62
-
63
- .tab-group{
64
-
65
- display: flex;
66
-
67
- justify-content: space-between;
68
-
69
- flex-wrap: wrap;
223
+ 全ての部分のタグが表示されます。
70
-
71
- align-items: flex-end;
72
-
73
- }
74
-
75
- .tab{
76
-
77
- width: 130px;
78
-
79
- background: #dbedf0; /* タブのカラー */
80
-
81
- border-radius: 10px 10px 0 0;
82
-
83
- color: black;
84
-
85
- cursor: pointer;
86
-
87
- display: inline-block;
88
-
89
- font-size: 16px;
90
-
91
- padding: 12px 15px 12px;
92
-
93
- text-align: center;
94
-
95
- transition: 1s;
96
-
97
- vertical-align: bottom;
98
-
99
- }
100
-
101
- .panel{
102
-
103
- display:none;
104
-
105
- }
106
-
107
- .panel.is-show{
108
-
109
- display: block;
110
-
111
- }
112
-
113
- .tab.is-active{
114
-
115
- transition: 1s;
116
-
117
- opacity: 0.6;
118
-
119
- padding-bottom: 20px;
120
-
121
- }
122
-
123
- ```
124
-
125
-
126
-
127
- ```php
128
-
129
-
130
-
131
-                <div id="NEWS">
132
-
133
- <div class="NEWS-title">
134
-
135
- <h1>news</h1>
136
-
137
- </div>
138
-
139
- <div class="tab-wrap">
140
-
141
- <div class="tab-group">
142
-
143
- <div class="tab is-active">全て</div>
144
-
145
- <div class="tab">お知らせ</div>
146
-
147
- <div class="tab">ブログ</div>
148
-
149
- </div>
150
-
151
- </div>
152
-
153
- <div class="panel-group">
154
-
155
- <div class="panel is-show">
156
-
157
- <?php
158
-
159
- $paged = get_query_var('paged') ? get_query_var('paged') : 1 ;
160
-
161
- $args = array(
162
-
163
- 'post_type' => 'post',
164
-
165
- 'category_name' => 'news,blog',
166
-
167
- 'posts_per_page' => 3,
168
-
169
- 'total' => 99,
170
-
171
- 'paged' => $paged
172
-
173
- );
174
-
175
- $the_query = new WP_Query( $args );
176
-
177
- if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) :
178
-
179
- $the_query->the_post(); ?>
180
-
181
- <div class="left-post-date">
182
-
183
- <?php echo get_the_date(); ?>
184
-
185
- </div>
186
-
187
- <div class="left-post-item">
188
-
189
- <?php the_category(); ?>
190
-
191
- </div>
192
-
193
- <a href="<?php the_permalink(); ?>" class="left-post-title">
194
-
195
- <?php echo get_the_title(); ?></a>
196
-
197
- <?php endwhile; ?>
198
-
199
- <?php endif; ?>
200
-
201
- <div class="nav-previous alignleft"><?php next_posts_link( '<img src="'. get_template_directory_uri().'/img/競技.png" />' ); ?></div>
202
-
203
- <div class="nav-next alignright"><?php previous_posts_link( '<img src="'. get_template_directory_uri().'/img/競技-2.png" />' ); ?></div>
204
-
205
- <?php wp_reset_postdata(); ?>
206
-
207
- <?php if (function_exists("pagination")) { pagination($additional_loop->max_num_pages);
208
-
209
- } ?>
210
-
211
- </div>
212
-
213
- <div class="panel">
214
-
215
- <?php
216
-
217
- $args = array(
218
-
219
- 'post_type' => 'news',
220
-
221
- 'category_name' => 'news',
222
-
223
- 'posts_per_page' => 3,
224
-
225
- );
226
-
227
- $the_query = new WP_Query( $args );
228
-
229
- if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) :
230
-
231
- $the_query->the_post(); ?>
232
-
233
- <div class="center-news-date">
234
-
235
- <?php echo get_the_date(); ?>
236
-
237
- </div>
238
-
239
- <div class="center-news-item">
240
-
241
- <?php the_category(); ?>
242
-
243
- </div>
244
-
245
- <a href="<?php the_permalink(); ?>" class="center-news-title">
246
-
247
- <?php the_title(); ?></a>
248
-
249
- <?php endwhile; ?>
250
-
251
- <?php endif; ?>
252
-
253
- <?php wp_reset_postdata(); ?>
254
-
255
- </div>
256
-
257
- <div class="panel">
258
-
259
- <?php
260
-
261
- $args = array(
262
-
263
- 'post_type' => 'blog',
264
-
265
- 'category_name' => 'blog',
266
-
267
- 'posts_per_page' => 3,
268
-
269
- );
270
-
271
- $the_query = new WP_Query( $args );
272
-
273
- if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) :
274
-
275
- $the_query->the_post(); ?>
276
-
277
- <div class="left-news-date">
278
-
279
- <?php echo get_the_date(); ?>
280
-
281
- </div>
282
-
283
- <div class="left-news-item">
284
-
285
- <?php the_category(); ?>
286
-
287
- </div>
288
-
289
- <a href="<?php the_permalink(); ?>" class="left-news-title">
290
-
291
- <?php the_title(); ?></a>
292
-
293
- <?php endwhile; ?>
294
-
295
- <?php endif; ?>
296
-
297
- <?php wp_reset_postdata(); ?>
298
-
299
- </div>
300
-
301
- </div>
302
-
303
- </div>
304
-
305
- ```

3

修正

2020/09/16 04:37

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,13 +1,5 @@
1
1
  タブパネルがいきなり機能しなくなリました。エラーの内容がわからず対策できませんでした。
2
2
 
3
- Uncaught TypeError: ((n.event.special[g.origType] || {}).handle || g.handler).apply is not a function
4
-
5
- at HTMLDivElement.dispatch (jquery.js?ver=1.12.4-wp:3)
6
-
7
- at HTMLDivElement.r.handle (jquery.js?ver=1.12.4-wp:3)
8
-
9
- このようなエラーが出てます。
10
-
11
3
  コードみにくくてすみません
12
4
 
13
5
  幅を広げるときちんと機能します。

2

修正

2020/09/14 07:09

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -10,6 +10,8 @@
10
10
 
11
11
  コードみにくくてすみません
12
12
 
13
+ 幅を広げるときちんと機能します。
14
+
13
15
  回答よろしくお願いします。
14
16
 
15
17
  ```js

1

修正

2020/09/14 06:22

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
File without changes