แสดง category ใน wordpress โดยไม่แสดง parent

เริ่มโดย a125236, 28 สิงหาคม 2012, 19:16:20

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

a125236

รบกวนสอบถามโค๊ด ใช้แสดง category ใน wordpress โดยไม่แสดง parent

<?php the_category(', ' ); ?>

โคดแสดง category  จะแสดง parent ด้วยค่ะ

ถ้า เป็นโคดแสดงแต่ category ต้องเขียนแบบไหนค่ะ

ขอบคุณค่ะ =)))))  :wanwan017:

vii


a125236


vii

สวดยวดแปลว่าไม่ได้  :'(


ลองดูอันนี้


<?php
$current_cat 
intvalget_query_var('cat') );
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args=array(
  
'category__in' => array($current_cat),
  
'paged' => $paged,
  
'post_type' => 'post',
  
'post_status' => 'publish',
  
'posts_per_page' => -1,
  
'caller_get_posts'=> 1
);
query_posts($args);

?>

http://wordpress.org/support/topic/how-to-display-parent-category-posts-without-child-category-posts

c0untry-m@n