简体   繁体   English

我应该使用Wordpress Multisite吗?

[英]Should I use Wordpress Multisite?

I'm about to start on a new project but I'm doubting if I should use Multisite for the company's structure or not. 我将要开始一个新项目,但我不确定是否应将Multisite用于公司的结构。

The situation is as follows; 情况如下;

Corporation is based in a few EU countries, which each of the country websites have a consumer website and a professional website. 公司总部位于几个欧盟国家/地区,每个国家/地区的网站都有一个消费者网站和一个专业网站。

My thought was; 我的想法是; Use multisite to make the consumer/professional switch and use WPML for each website. 使用多站点进行用户/专业切换,并对每个网站使用WPML。 Things went fine so far. 到目前为止一切都很好。 Yet; 然而; all websites have one shared product database. 所有网站都有一个共享的产品数据库。 I'd like to make a custom post type "Products" and have them available in every language on every website (Consumer/Pro). 我想创建一个自定义帖子类型“产品”,并在每种网站(消费者/专业版)上以每种语言提供它们。 Yet I cant find a way to have it (easily managable) share that product database and its relations. 但是我找不到一种方法(易于管理)共享该产品数据库及其关系。

So there's my doubt on using MultiSite, and as of yet, I dont see any other option to get what I want; 因此,我对使用MultiSite表示怀疑,并且到目前为止,我还没有看到任何其他选择来获得所需的东西。 Consumer/Professional sites, all with their own content, but with a shared product database. 消费者/专业站点,都具有自己的内容,但是具有共享的产品数据库。

You can use the switch_to_blog() function within your product archive ( http://codex.wordpress.org/WPMU_Functions/switch_to_blog ). 您可以在产品档案库( http://codex.wordpress.org/WPMU_Functions/switch_to_blog )中使用switch_to_blog()函数。 This would allow you to get the products from another site within the multisite. 这将使您能够从多站点中的另一个站点获取产品。 Then use restore_current_blog() to return back to your individual site. 然后,使用restore_current_blog()返回您的个人站点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM