測試結果
jPages目前只能配合1.7.1 JQUERY
2013年8月27日 星期二
如果the_content(),沒有出現任何output
請服用
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>.
//the_content();
<?php endwhile; ?>
<?php endif; ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>.
//the_content();
<?php endwhile; ?>
<?php endif; ?>
2013年8月26日 星期一
目前的CATEGORY NAME(只勾選一個的話)
//目前分類的名稱
<?php
$category = get_the_category();
echo $category[0]->cat_name;
?>
//目前分類的母分類名稱
<?php
$category=get_the_category();
$parent_cat= $category[0]->category_parent;
$thisCat= get_category($parent_cat,false);
echo $thisCat->name;
?>
//以上測試過 適用於該產品分類只屬於一個並沒有同時屬於第二個分類,因為[0]是取第一個
<?php
$category = get_the_category();
echo $category[0]->cat_name;
?>
//目前分類的母分類名稱
<?php
$category=get_the_category();
$parent_cat= $category[0]->category_parent;
$thisCat= get_category($parent_cat,false);
echo $thisCat->name;
?>
//以上測試過 適用於該產品分類只屬於一個並沒有同時屬於第二個分類,因為[0]是取第一個
2013年8月22日 星期四
list category
如果不愛<?php wp_list_categories( $args ); ?>
請服用以下
<?php $args=array(
'orderby' => 'name',
'order' => 'ASC',
'show_count' => true,
'title_li' => '',
'child_of' => 5,
);
$categories = get_categories($args);
foreach($categories as $category) {
$output = '<li>';
$output .= '<a href="' . get_category_link($category->term_id) . '">' . $category->name . '</a></li>';
echo $output;
}
?>
訂閱:
文章 (Atom)