จากรูปจะเห็นได้ว่า มี 2 Cat คือ "sole-agent" กับ "project"
ถ้าผมต้องการให้มันโชว์ cat แค่ sole-agent ต้องทำยังไงครับ
code ที่เกี่ยวข้องครับ ชื่อ plugin Portfolio Post Type By Decneo
<?php
$args=array('post_type' => $posttype,'posts_per_page' =>-1);
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query($args);
$terms = get_terms($postcat);
$count = 1;
?>
<?php if ($wp_query->have_posts()) : ?>
<?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<?php
$custom = get_post_custom($post->ID);
$port_list = get_the_term_list( $post->ID, $postcat, '', ', ', '' );
$allcategory = get_the_term_list( $post->ID, $postcat, '', '_', '' );
$allcategory = strip_tags($allcategory);
$allcategory = strtolower($allcategory);
$allcategory = str_replace(' ', '-', $allcategory);
$allcategory = str_replace('_', ' ', $allcategory);
$all_title = get_the_title();
$blogimageurl_p = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
if ($blogimageurl_p == "") {
$blogimageurl_p = get_template_directory_uri().'/images/demo.jpg';
}
$aq_image_p = aq_resize( $blogimageurl_p, 400, 400, true );
global $decneo_term;
$website_url = (isset($custom["website_url"][0]) ? strip_tags($custom["website_url"][0]) : '');
$video_link = (isset($custom["video_link"][0]) ? strip_tags($custom["video_link"][0]) : '');
$project_progress = (isset($custom["project_progress"][0]) ? strip_tags($custom["project_progress"][0]) : '');
$name_progress = (isset($custom["name_progress"][0]) ? strip_tags($custom["name_progress"][0]) : '');
?>
+1 ครับ
