傻大憨

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是一个关注跨境电商、创业话题的网站。

使用Elementor搭建网站的缺点

虽然Elementor是一个非常流行的WordPress页面构建器,但它也存在一些缺点。这些缺点可能导致非专业人员在使用Elementor时遇到困难,或者无法正确地构建和优化网站。

wordpress禁用Rest API

将以下代码插入到functions.php文件中即可禁用Rest API

wordpress移除wp_head不常用代码

把不常用的代码移除,让wordpress快起来,想要非一样的感觉,可以试试。

wordpress禁用xmlrpc

将以下代码插入到functions.php文件中即可

GGD独立站与DTC独立站的区别

GGD独立站(可能指“工厂直销独立站”或“Global Goods Direct”)与DTC独立站(Direct-to-Consumer,直接面向消费者)在商业模式、目标受众和运营策略上存在显著差异。

WordPress免费主题安全下载指南:避免陷阱 保护你的网站

WordPress主题是一个非常经济的选择。然而,免费主题的安全隐患正成为一个不容忽视的问题。本文将深入探讨如何安全下载和使用WordPress免费主题,帮助你避开那些可能带来灾难性后果的”坑”。