傻大憨

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

跨境电商独立站建的真实费用

跨境电商独立站建的真实费用是多少,看了这个明细,就一目了然了。

知识共享署名4.0许可

建网站过程中经常使用到的知识共享署名CC4.0许可,来自署名 4.0 国际官网的具体规定的内容介绍。

WordPress为某个分类添加特定的内容页模板

为某个分类目录category添加特定的内容页single模板

如何在wordpress顶部header.php中引用css/bootstrap.css文件

在 WordPress 的 header.php 文件中引用 CSS 文件(如 bootstrap.css)是实现主题样式化的一种常见方式。以下是具体的步骤和代码示例

一段代码就可禁止wordpress自动更新

进行过二次开发的wordpress网站,最好要把自动更新禁止了。不然,自动更新后的wordpress网站可能无法访问。

WordPress主题中添加自定义Owl Carousel轮播

首先,您需要在WordPress主题中安装Owl Carousel组件。可以通过WordPress主题文件目录安装Owl Carousel。