傻大憨

wordpress子分类使用父分类模板

子分类使用父分类模板

 function f_category_template($template){
	$category = get_queried_object();
	if($category->parent !='0'){
		while($category->parent !='0'){
			$category = get_category($category->parent);
		}
	}
	
	$templates = array();
 
	if ( $category ) {
		$templates[] = "category-{$category->slug}.php";
		$templates[] = "category-{$category->term_id}.php";
	}
	$templates[] = 'category.php';
	return locate_template( $templates );
}
Published
Categorized as 建站知识 Tagged ,

By 傻大憨

shadahan.com是一个关注跨境电商、创业话题的网站。

wordpress子页面调用父页面标题和链接

wordpress子页面调用父页面标题和链接

wordpress怎么调用页面别名

在制作wordpress主题时常常会用到调用页面的别名,下面这段代码可以完美解决,wordpress页面别名调用的问题。

重庆渝二娃:数字化赋能,助力企业扬帆远航!

渝二娃工作室是一家专注于网站建设和网络推广的科技先锋,致力于为企业量身定制全方位的数字化营销的解决方案。

wordpress调用全站热门文章

调用全站热门wordpress文章代码

wordpress不同页面调用不同的header

不同page页面,调用不同的顶部header文件。

B2B独立站用TradeTheme好还是SOHOTHEME好

两个主题都是WordPress生态中B2B外贸领域的优秀选择,没有绝对的“好”与“坏”,只有“适合”与“不适合”。TradeTheme是面向专业B2B工厂的“重型武器”,功能强大、目标明确;SOHOTHEME则是面向SOHO创业者的“轻骑兵”,高性价比、快速灵活。