wordpress 多站点_使用WordPress网络管理多个站点

wordpress 多站点

Here you are, a web developer currently working on several different WordPress sites at varying stages of development. They’re all in different directories on your domain so clients can have a look and see how they’re coming along. Out of nowhere, a major new WordPress version is released, and the Genesis framework you’re using to build all your sites needs to be updated.

在这里,您是一位Web开发人员,当前正在不同开发阶段在多个不同的WordPress网站上工作。 它们都位于您域中的不同目录中,因此客户可以查看并查看它们的进展情况。 毫无疑问,发布了一个主要的新WordPress版本,并且需要更新用于构建所有站点的Genesis框架。

Managing all your WordPress installations at a times like this can be a real hassle. This may not be your exact story, but I’m sure many of you can sympathize.

在这样的时间管理所有的WordPress安装可能是一个真正的麻烦。 这可能不是您的确切故事,但是我敢肯定,你们中的许多人都可以同情。

WordPress Network comes to the rescue in situations like this. Once you’ve set it up, you can put multiple sites in directories and subdomains with the click of a button. Since they all share the same WP installation you can update and edit them all in one fell swoop from your Network Admin dashboard.

在这种情况下,WordPress Network可以提供帮助。 设置好之后,您只需单击一下按钮,就可以将多个站点放置在目录和子域中。 由于它们共享相同的WP安装,因此您可以一次从Network Admin仪表板更新和编辑它们。

Before you start, unless this is a brand new WordPress installation with nothing to lose, you’ll probably want to back up your database and files. You also need to disable any active plugins. You can start them back up after the network setup is complete.

在开始之前,除非这是全新的WordPress安装,并且没有任何损失,否则您可能需要备份数据库和文件。 您还需要禁用任何活动的插件。 您可以在网络设置完成后将它们备份。

Now for the nuts and bolts of creating a new WordPress Network.

现在开始创建新的WordPress网络。

First you’ll need to enable Multisite. Use your FTP client or web server’s file browser and download a file called wp-config.php and save it to your desktop or a folder. Open it with your text editor and add this line above where it says "/* That's all, stop editing! Happy blogging. */".

首先,您需要启用多站点。 使用FTP客户端或Web服务器的文件浏览器,下载名为wp-config.php的文件,并将其保存到桌面或文件夹中。 使用您的文本编辑器将其打开,然后在"/* That's all, stop editing! Happy blogging. */"上方添加此行。

define('WP_ALLOW_MULTISITE', true);

Save the file and upload it back to the server. Since the original wp-config.php is still there, it will ask you which file you want to keep. Choose “replace” or “overwrite” to save the newer, edited version.

保存文件,然后将其上传回服务器。 由于原始的wp-config.php仍然存在,它将询问您要保留哪个文件。 选择“替换”或“覆盖”以保存更新的编辑版本。

You’ll need to refresh your admin panel in your browser to let these changes take effect.

您需要在浏览器中刷新管理面板,以使这些更改生效。

In your Tools menu in the left sidebar, you’ll now see the Network Setup item. Click on that and then go to Create a Network of WordPress Sites. Follow the directions and choose a few options such as the URL structure and network name.

现在,在左侧栏中的“ 工具”菜单中,您会看到“ 网络设置”项。 单击该按钮,然后转到创建WordPress网站网络 。 按照说明进行操作,然后选择一些选项,例如URL结构和网络名称。

You’ll then be prompted to make a blogs.dir directory in /wp-content and it will provide several more lines of code to add to the wp-config.php file.

然后,系统将提示您在/wp-content创建一个blogs.dir目录,它将提供更多行代码以添加到wp-config.php文件中。

It will also tell you to add some rules to .htaccess, a server text file used to work with permissions and configurations for each directory.

它还将告诉您向.htaccess (服务器文本文件,用于处理每个目录的权限和配置)添加一些规则。

Use your FTP program of choice to download this file. You may need to tell your FTP program not to hide this file, which you should be able to specify in the program’s options or preferences.

使用您选择的FTP程序下载此文件。 您可能需要告诉FTP程序不要隐藏该文件,您应该可以在程序的选项或首选项中指定该文件。

Even when you have downloaded the file, you may find your operating system’s file manager hides the file from you, so here are some directions for how to show it.

即使下载了文件,您也可能会发现操作系统的文件管理器对您隐藏了文件,因此,这里有一些如何显示文件的说明。

苹果电脑 (Mac)

Open Terminal, found in Applications/Utilities.

在“ 应用程序/实用工具”中找到的“开放终端”

Type/paste in this and hit return/enter:

在此输入/粘贴并点击回车/输入:

defaults write com.apple.finder AppleShowAllFiles -bool true

Finder must be restarted to allow this to take effect. In Terminal paste in this and hit enter:

Finder必须重新启动才能生效。 在终端中粘贴此内容,然后按Enter:

killall Finder

When you’re done, if you’d like to hide hidden files again, use the same line as used to hide it, but change “true” at the end to “false” and restart Finder.

完成后,如果要再次隐藏隐藏的文件,请使用与隐藏文件相同的行,但是最后将“ true”更改为“ false”,然后重新启动Finder。

视窗 (Windows)

Press the Start menu. Click on Control Panel, Appearance and Personalization, and then Folder Options. Go to the View tab. Under Advanced Settings, select “Show hidden files and folders” and hit “OK“.

开始菜单。 单击控制面板外观和个性化 ,然后单击文件夹选项 。 转到查看选项卡。 在“ 高级设置”下 ,选择“ 显示隐藏的文件和文件夹 ”,然后单击“ 确定 ”。

Once you have shown hidden files, open .htaccess and add the code given by WordPress Network Setup, save the file and re-upload it.

显示隐藏文件后,打开.htaccess并添加WordPress网络安装程序给出的代码,保存文件并重新上传。

It is possible that this file has not already been placed on your website. If, after setting your FTP program to display hidden files, you still don’t see the .htaccess file in your website’s root public directory, you’ll need to create a new one.

该文件可能尚未放置在您的网站上。 如果在将FTP程序设置为显示隐藏文件后,仍然在网站的根公共目录中看不到.htaccess文件,则需要创建一个新文件。

Create a new file in your text editor, paste in the code given by WordPress Network Setup, save that as .htaccess to your desktop or a folder, and upload it to the server, in the root public directory of your website.

在文本编辑器中创建一个新文件,粘贴WordPress Network Setup提供的代码,将其另存为.htaccess到桌面或文件夹,然后将其上载到网站根公共目录中的服务器。

When you log into the Network Admin, you’ll now see a “My Sites” item. Hover over that, and under “Network Admin”, there will be several administration items. When you click on “Sites”, you can add new sites with the click of a button!

登录到网络管理员后 ,您现在将看到“我的网站”项。 将鼠标悬停在其上方,在“网络管理员”下,将有几个管理项目。 当您单击“站点”时,您可以单击一个按钮来添加新站点!

Back under the main “My Sites” menu, you can manage all the network sites.

返回“我的网站”主菜单下,您可以管理所有网络站点。

Setup is complete!

安装完成!

Now, with your WordPress network, updating and making changes to all your sites is simple and far less time-consuming.

现在,借助您的WordPress网络,对所有站点进行更新和更改变得非常简单,并且耗时更少。

翻译自: https://www.sitepoint.com/managing-multiple-sites-with-wordpress-network/

wordpress 多站点

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值