如何在WordPress中为页面使用多个主题

With a little styling tweaks, you can easily create templates for pages, sections, and even a single post in your WordPress theme. But what if you wanted to use a completely different theme for a section or page on your website? In this article, we will show you how to use multiple themes for pages in WordPress.

通过一些样式调整,您可以轻松地为WordPress主题中的页面,部分甚至单个帖子创建模板。 但是,如果您想为网站的某个部分或页面使用完全不同的主题该怎么办? 在本文中,我们将向您展示如何在WordPress中为页面使用多个主题。

准备您的网站以使用多个主题 (Preparing Your Site for Using Multiple Themes)

Before you begin, you need to create a complete WordPress backup and turn off any caching plugins like W3 Total Cache or WP Super Cache on your site.

在开始之前,您需要创建一个完整的WordPress备份并关闭站点上的所有缓存插件,例如W3 Total CacheWP Super Cache

Sometimes caching plugins will show you an older version of the page which may restrict your ability to see changes properly.

有时,缓存插件会为您显示页面的较旧版本,这可能会限制您正确查看更改的能力。

Make sure that the themes you want to use are installed in WordPress. You can only activate one theme at a time, but you can install as many themes as you want. See our guide on how to install a WordPress theme.

确保要使用的主题已安装在WordPress中。 您一次只能激活一个主题,但是可以根据需要安装任意数量的主题。 请参阅有关如何安装WordPress主题的指南

Themes installed on a WordPress site
影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

在WordPress中使用多个主题 (Using Multiple Themes in WordPress)

First thing you need to do is install activate the jonradio Multiple Themes plugin. Upon activation you need to visit Appearance » Multiple Themes plugin to configure the plugin.

您需要做的第一件事是安装激活jonradio Multiple Themes插件。 激活后,您需要访问外观»多个主题插件以配置该插件。

Multiple Themes plugin settings

The plugin comes with extensive information about how to use the plugin. Each section on the settings page is explained in full detail. We will try to summarize those settings for you.

该插件随附有关如何使用该插件的大量信息。 设置页面上的每个部分都有详细说明。 我们将尝试为您总结这些设置。

There are three ways you can set up multiple themes. The first option allows you to set a different theme for your site’s homepage. Simply choose a theme from the dropdown menu and click on the save all changes button.

您可以通过三种方式设置多个主题。 第一个选项使您可以为网站的首页设置不同的主题。 只需从下拉菜单中选择一个主题,然后单击保存所有更改按钮。

Site's Homepage theme

The second option is to provide a full URL, use a URL prefix, or an Asterisk in URL. Any pages matching the URL will use the theme you define here.

第二个选项是提供完整的URL,使用URL前缀或URL中的星号。 与URL匹配的所有页面都将使用您在此处定义的主题。

Define theme based on URL or Prefix

The third method to apply theme is by using a query keyword. Any URLs containing the keyword you define will use the theme defined in this setting.

应用主题的第三种方法是使用查询关键字。 包含您定义的关键字的所有URL都将使用此设置中定义的主题。

Use a theme based on query keyword
更改主题选项 (Changing Theme Options)

Please note that when you apply a theme to a section, page, or query, it does not change your current active theme. In order to configure a theme you will have to temporarily activate it. Lets suppose that you are using Twenty Thirteen theme on your website, and you applied Twenty Fourteen on a particular page on your website.

请注意,将主题应用于节,页面或查询时,它不会更改当前的活动主题。 为了配置主题,您将不得不临时激活它。 假设您在网站上使用“二十十三”主题,并且在网站的特定页面上应用了“二十十四”。

To configure theme options for Twenty Fourteen, simply go to Appearance » Themes and activate Twenty Fourteen theme. Now you are free to make changes to the theme using Appearance » Customize.

要为“二十四岁”配置主题选项,只需转到外观»主题并激活“二十四岁”主题。 现在,您可以使用外观»自定义来自由更改主题。

Changing theme options for a non-active theme

Once you are satisfied with the theme setup, save your changes and then come back to Appearance » Themes and reactivate your old Twenty Thirteen theme.

对主题设置满意后,保存所做的更改,然后返回到外观»主题,然后重新激活旧的“二十三十三”主题。

For more advanced theme options, see the Theme Options tab on the plugin’s settings page.

有关更多高级主题选项,请参阅插件设置页面上的“主题选项”选项卡。

Configuring theme options

That’s all for now. We hope that this article helped you learn how to use multiple themes for pages in WordPress.

目前为止就这样了。 我们希望本文能帮助您学习如何在WordPress中为页面使用多个主题。

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Google+.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterGoogle+上找到我们。

翻译自: https://www.wpbeginner.com/wp-themes/how-to-use-multiple-themes-for-pages-in-wordpress/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值