質問編集履歴

3

言葉つついか

2021/07/04 13:57

投稿

takumi1113
takumi1113

スコア7

test CHANGED
File without changes
test CHANGED
@@ -13,6 +13,8 @@
13
13
  言葉が分かり図楽申し訳ございません。
14
14
 
15
15
 
16
+
17
+ 下記 index.php
16
18
 
17
19
  ```ここに言語を入力
18
20
 

2

コードの編集

2021/07/04 13:57

投稿

takumi1113
takumi1113

スコア7

test CHANGED
File without changes
test CHANGED
@@ -15,10 +15,6 @@
15
15
 
16
16
 
17
17
  ```ここに言語を入力
18
-
19
- コード
20
-
21
- ```
22
18
 
23
19
  <section class="section section-project">
24
20
 
@@ -129,3 +125,5 @@
129
125
  </div>
130
126
 
131
127
  </section>
128
+
129
+ ```

1

コードの挿入

2021/07/04 13:54

投稿

takumi1113
takumi1113

スコア7

test CHANGED
File without changes
test CHANGED
@@ -11,3 +11,121 @@
11
11
 
12
12
 
13
13
  言葉が分かり図楽申し訳ございません。
14
+
15
+
16
+
17
+ ```ここに言語を入力
18
+
19
+ コード
20
+
21
+ ```
22
+
23
+ <section class="section section-project">
24
+
25
+ <h2 class="section-title section-title__project">Project</h2>
26
+
27
+ <div class="project-wrapper">
28
+
29
+ <ul class="project-list">
30
+
31
+ <?php
32
+
33
+ global $query_string;
34
+
35
+ query_posts(
36
+
37
+ Array(
38
+
39
+ 'post_type' => array( 'works' ),
40
+
41
+ 'tax_query' => array(
42
+
43
+ array(
44
+
45
+ 'taxonomy' => 'pickup', //タクソノミー名を指定
46
+
47
+ 'field' => 'slug',
48
+
49
+ 'terms' => 'pickup',
50
+
51
+ 'operator' => 'IN' //'AND'、'IN'、'NOT IN'の何れかを指定
52
+
53
+ )
54
+
55
+ ),
56
+
57
+ // 'showposts' => 5,
58
+
59
+ 'posts_per_page' => 6,
60
+
61
+ 'paged' => get_query_var('paged')
62
+
63
+ )
64
+
65
+ );
66
+
67
+ if (have_posts()) {
68
+
69
+ while (have_posts()) {
70
+
71
+ the_post();
72
+
73
+ ?>
74
+
75
+ <li class="project-listItem f-right">
76
+
77
+ <a href="<?php the_permalink(); ?>">
78
+
79
+ <div class="project-img">
80
+
81
+ <?php the_post_thumbnail(); ?>
82
+
83
+ </div>
84
+
85
+ <h3><?php the_title(); ?></h3>
86
+
87
+ </a>
88
+
89
+ <div class="project-meta">
90
+
91
+ <ul class="meta-list">
92
+
93
+ <?php
94
+
95
+ $terms = get_the_terms($post->ID,'workstag');
96
+
97
+ foreach( $terms as $term ) {
98
+
99
+ echo '<li><a href="'.get_term_link($term->slug,'workstag').'">'.$term->name.'</a></li>';
100
+
101
+ }
102
+
103
+ ?>
104
+
105
+ </ul>
106
+
107
+ </div>
108
+
109
+ <a href="<?php the_permalink(); ?>" class="btn btn-project">more</a>
110
+
111
+ </li>
112
+
113
+ <?php
114
+
115
+ }
116
+
117
+ }else{
118
+
119
+ }
120
+
121
+ wp_reset_query();
122
+
123
+ ?>
124
+
125
+ </ul>
126
+
127
+ <a href="" class="btn btn-all">All Projects</a>
128
+
129
+ </div>
130
+
131
+ </section>