wordpress - 不同页面的独特主题 [英] wordpress - unique theme for different pages
问题描述
我是 wordpress 的新手.我正在尝试基于它建立一个自定义网站.我知道一些 php 和相当不错的 html\css\js.我想知道是否可以为不同的页面设置一个独特的主题?
I am new to wordpress. I am trying to build a custon website based on it. I know some php and quite good html \ css \ js. I wanted to know if it's possible to set a uinque theme for different pages?
谢谢!
推荐答案
您可以使用主题中的 header.php 文件以编程方式执行此操作.
You can do it programmatically with the header.php files in your theme.
我建议使用 Carrington 主题框架(http://carringtontheme.com/- 下载 JAM 以获得可以填充的空白主题).使用此框架,您可以非常轻松地根据页面、作者、类别、标签和其他属性更改模板文件.因此,您可以放入不同的标题模板,根据页面 slug 加载不同的 CSS.
I'd recommend using the Carrington theme framework (http://carringtontheme.com/ - download JAM to just get a blank theme that you can populate). With this framework you can very easily change template files according to page, author, category, tag and other attributes. So you could drop in a different header template that loads different CSS depending on page slug.
我不会去加载单独的主题,但如果你真的想走那条路,那么你应该做子主题并在 option_current_theme
上放置一个过滤器,以便你可以通过编程控制将主题分配给各个资源.
I wouldn't go as far as to load separate themes, but if you really want to go that route then you should do child themes and put a filter on option_current_theme
so that you can programmatically control the assignment of themes to individual resources.
这篇关于wordpress - 不同页面的独特主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!