質問編集履歴
2
ソースコードを一部修正させていただきました
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
ソースコードを一部修正させていただきました
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,7 +14,29 @@
|
|
14
14
|
|
15
15
|
```ここに言語名を入力
|
16
16
|
|
17
|
+
<?php $userId = get_query_var('author'); ?>
|
18
|
+
|
19
|
+
<?php $user = get_userdata($userId); ?>
|
20
|
+
|
21
|
+
|
22
|
+
|
17
|
-
$posts = get_posts("author=$userId&orderby=date&post_type='カスタム投稿名'&numberposts=5");
|
23
|
+
<?php $posts = get_posts("author=$userId&orderby=date&post_type='カスタム投稿名'&numberposts=5"); ?>
|
24
|
+
|
25
|
+
<?php if (!empty($posts)) { ?>
|
26
|
+
|
27
|
+
<ul>
|
28
|
+
|
29
|
+
<?php foreach( $posts as $post ) : setup_postdata($post); ?>
|
30
|
+
|
31
|
+
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
|
32
|
+
|
33
|
+
<?php endforeach; ?>
|
34
|
+
|
35
|
+
<?php wp_reset_postdata(); ?>
|
36
|
+
|
37
|
+
</ul>
|
38
|
+
|
39
|
+
<?php } ?>
|
18
40
|
|
19
41
|
```
|
20
42
|
|