質問編集履歴

2

phpの更新

2019/02/02 15:58

投稿

goldenb
goldenb

スコア29

test CHANGED
File without changes
test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- 現在プラグインはACFの有料版が入っていま
11
+ 現在プラグインはACFのギャラリーでアイキャッチとモーダル内の画像の受け渡しはできているのですがモーダルが表示できせん
12
12
 
13
13
 
14
14
 
@@ -16,29 +16,19 @@
16
16
 
17
17
 
18
18
 
19
- ※まだテキストをwordpress化出来ていません。
20
-
21
19
 
22
20
 
23
21
  ```php
24
22
 
25
- <?php
23
+ <section id="grid_layout">
26
24
 
27
- $args = array(
28
-
29
- 'post_type' => 'gallery', /* カスタム投稿名が「gourmet」の場合 */
30
-
31
- 'posts_per_page' => 30, /* 表示する数 */
25
+ <div class="grid_layout-1 grid_layout-inner">
32
-
33
- );
34
-
35
- ?>
36
26
 
37
27
 
38
28
 
39
- <?php $my_query = new WP_Query( $args ); ?>
29
+ <?php if (have_posts()) : ?>
40
30
 
41
- <?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
31
+ <?php while (have_posts()) : the_post(); ?>
42
32
 
43
33
 
44
34
 
@@ -48,15 +38,23 @@
48
38
 
49
39
  <?php the_post_thumbnail(); ?>
50
40
 
41
+ <figcaption class="hover-mask">
42
+
43
+ <h1>
44
+
45
+ <?php the_title(); ?>
46
+
47
+ </h1>
48
+
49
+ <p>
50
+
51
+ <?php the_content(); ?>
52
+
53
+ </p>
54
+
55
+ </figcaption>
56
+
51
57
  </figure>
52
-
53
- <figcaption class="hover-mask">
54
-
55
- <h1>タイトル</h1>
56
-
57
- <p>説明テキスト</p>
58
-
59
- </figcaption>
60
58
 
61
59
  <div class="modal" data-modalIndex="31">
62
60
 
@@ -64,9 +62,17 @@
64
62
 
65
63
  <div class="modal_text">
66
64
 
67
- <h1>タイトル</h1>
65
+ <h1>
68
66
 
67
+ <?php the_title(); ?>
68
+
69
+ </h1>
70
+
71
+ <p>
72
+
73
+ <?php the_content(); ?>
74
+
69
- <p>説明テキスト</p>
75
+ </p>
70
76
 
71
77
  </div>
72
78
 
@@ -78,23 +84,21 @@
78
84
 
79
85
  <div>
80
86
 
81
- <?php
87
+ <?php
82
88
 
83
- $images = get_field( 'gallery_modal_img' );
89
+ $images = get_field('gallery_modal_img');
84
90
 
85
- if ( $images ):
91
+ $size = 'full';
86
92
 
87
- ?>
93
+ if( $images ):
88
94
 
89
- <ul class="photo-gallery">
95
+ ?>
90
96
 
91
97
  <?php foreach( $images as $image ): ?>
92
98
 
93
- <img src="<?php echo $image['sizes']['full']; ?>" alt="<?php echo $image['alt']; ?>"/>
99
+ <?php echo wp_get_attachment_image( $image['ID'], $size ); ?>
94
100
 
95
101
  <?php endforeach; ?>
96
-
97
- </ul>
98
102
 
99
103
  <?php endif; ?>
100
104
 
@@ -110,8 +114,16 @@
110
114
 
111
115
  <!-- △ ループ終了 △ -->
112
116
 
117
+
118
+
113
119
  <?php endwhile; ?>
114
120
 
121
+ <?php endif; ?>
122
+
115
- <?php wp_reset_postdata(); ?>
123
+ <?php wp_reset_query(); ?>
124
+
125
+ </div>
126
+
127
+ </section>
116
128
 
117
129
  ```

1

php追加

2019/02/02 15:58

投稿

goldenb
goldenb

スコア29

test CHANGED
File without changes
test CHANGED
@@ -13,3 +13,105 @@
13
13
 
14
14
 
15
15
  当方WordPressでの制作が初めてで伝えるべき情報漏れ等あるかもしれませんがご教授の程お願いいたします。
16
+
17
+
18
+
19
+ ※まだテキストをwordpress化出来ていません。
20
+
21
+
22
+
23
+ ```php
24
+
25
+ <?php
26
+
27
+ $args = array(
28
+
29
+ 'post_type' => 'gallery', /* カスタム投稿名が「gourmet」の場合 */
30
+
31
+ 'posts_per_page' => 30, /* 表示する数 */
32
+
33
+ );
34
+
35
+ ?>
36
+
37
+
38
+
39
+ <?php $my_query = new WP_Query( $args ); ?>
40
+
41
+ <?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
42
+
43
+
44
+
45
+ <!-- ▽ ループ開始 ▽ -->
46
+
47
+ <figure class="grid_item modalBtn" data-modalIndex="31">
48
+
49
+ <?php the_post_thumbnail(); ?>
50
+
51
+ </figure>
52
+
53
+ <figcaption class="hover-mask">
54
+
55
+ <h1>タイトル</h1>
56
+
57
+ <p>説明テキスト</p>
58
+
59
+ </figcaption>
60
+
61
+ <div class="modal" data-modalIndex="31">
62
+
63
+ <div class="modal_inner">
64
+
65
+ <div class="modal_text">
66
+
67
+ <h1>タイトル</h1>
68
+
69
+ <p>説明テキスト</p>
70
+
71
+ </div>
72
+
73
+ <a class="modalClose" type="button"><span></span><span></span></a>
74
+
75
+ <div class="modal_scroll">
76
+
77
+ <div class="modal_content">
78
+
79
+ <div>
80
+
81
+ <?php
82
+
83
+ $images = get_field( 'gallery_modal_img' );
84
+
85
+ if ( $images ):
86
+
87
+ ?>
88
+
89
+ <ul class="photo-gallery">
90
+
91
+ <?php foreach( $images as $image ): ?>
92
+
93
+ <img src="<?php echo $image['sizes']['full']; ?>" alt="<?php echo $image['alt']; ?>"/>
94
+
95
+ <?php endforeach; ?>
96
+
97
+ </ul>
98
+
99
+ <?php endif; ?>
100
+
101
+ </div>
102
+
103
+ </div>
104
+
105
+ </div>
106
+
107
+ </div>
108
+
109
+ </div>
110
+
111
+ <!-- △ ループ終了 △ -->
112
+
113
+ <?php endwhile; ?>
114
+
115
+ <?php wp_reset_postdata(); ?>
116
+
117
+ ```