/** * 根据别名查找分类属性 * @param type $slug * @param type $type * @return type */ function getCategoryProperty($slug,$type){ $property = null; $catname = get_category_by_slug($slug); if($type == 'name'){ $property = $catname->name; } if($type == 'slug'){ $property = $catname->slug; } if($type == 'id'){ $property = $catname->cat_ID; } if($type == 'parent'){ $property = $catname->parent; } if($type == 'link'){ $property = get_category_link($catname->cat_ID); } return $property; }
根据别名查找分类属性
猜你喜欢
转载自haimingyoung.iteye.com/blog/2278401
今日推荐
周排行