4
我顯示類別後孩子list.list顯示所有 我需要顯示只有6個(孩子) 幫助我們......如何設置分類列表限制?
例如: 菜單(父) 列表1(子) 列表2(子) 項目list3(子) list4(子) list5(子) list6(子) list7(子) list8(子)
<?php $article_categories = get_categories(array(
'child_of' => get_category_by_slug('work')->term_id
));
$talentChildren = get_categories(array('child_of' => get_category_by_slug('talent')->term_id));
?>
<?php if (have_posts()) : ?>
<?php $talent_Children = array($talentChildren[0]); ?>
<?php foreach($talent_Children as $talent): ?>
<?php
$talentSubChildren = new WP_Query();
$talentSubChildren->query(array('category_name' => $talent->slug));
?>
<h2><a href="<?php the_permalink() ?>talent/directors/"><?php echo $talent->name; ?></a></h2>
<ul>
<?php while ($talentSubChildren->have_posts()) : $talentSubChildren->the_post(); ?>
<li>
<h4><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</h4>
</li>
<?php endwhile; ?>
</ul>
<?php endforeach; ?>
<?php endif; ?>
</div>
我接收 - >語法錯誤,意想不到 '=>'(T_DOUBLE_ARROW)如何解決編輯這個錯誤 – Kannan 2014-10-17 11:30:21
。 pl現在試試 – 2014-10-17 11:40:00
你嘗試過嗎?工作? – 2014-10-17 12:31:18