teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

3

get termsの使い方を追記しました。

2019/02/10 13:16

投稿

northcastle
northcastle

スコア10

title CHANGED
File without changes
body CHANGED
@@ -40,6 +40,35 @@
40
40
 
41
41
  pad_countsを「1 (true)」にしても、値を取得できません。
42
42
 
43
+ ```PHP
44
+ $args = array(
45
+ 'orderby' => 'name',
46
+ 'order' => 'ASC',
47
+ 'hide_empty' => true,
48
+ 'exclude' => array(),
49
+ 'exclude_tree' => array(),
50
+ 'include' => array(),
51
+ 'number' => '',
52
+ 'fields' => 'all',
53
+ 'slug' => '',
54
+ 'parent' => '',
55
+ 'hierarchical' => true,
56
+ 'child_of' => 0,
57
+ 'childless' => false,
58
+ 'get' => '',
59
+ 'name__like' => '',
60
+ 'description__like' => '',
61
+ 'pad_counts' => true,
62
+ 'offset' => '',
63
+ 'search' => '',
64
+ 'cache_domain' => 'core'
65
+ );
66
+
67
+ $termsParentCat = get_terms( $taxonomies, $args );
68
+
69
+ (全<?php echo $termsParentCat->count ?>件)
70
+ ```
71
+
43
72
  ### 補足情報(FW/ツールのバージョンなど)
44
73
 
45
74
  ここにより詳細な情報を記載してください。

2

不足していたソースコードを追記しました。

2019/02/10 13:16

投稿

northcastle
northcastle

スコア10

title CHANGED
File without changes
body CHANGED
@@ -17,6 +17,7 @@
17
17
  ### 該当のソースコード
18
18
 
19
19
  ```PHP
20
+ $term = get_queried_object();
20
21
  <?php $children = get_term_children($cat, 'category'); ?>
21
22
  <?php if(empty($children)) :?>
22
23
  (全<?php echo $term->count ?>件)

1

不足していたソースコードを追記しました。

2019/02/10 12:35

投稿

northcastle
northcastle

スコア10

title CHANGED
File without changes
body CHANGED
File without changes