简体   繁体   English

WordPress多站点,如何选择不是主要站点的其他站点

[英]WordPress multi-site, how to select other sites that are not the main one

I'm working in WordPress... and I need to show different post on the footer. 我正在使用WordPress ...,我需要在页脚上显示其他帖子。 The thing is... I had a multi-site with two sites, so It was easy to customize as I want each footer with 事情是...我有一个包含两个站点的多站点,因此易于定制,因为我希望每个页脚都具有

if(is_main_site()) {

} else {

}

But now I have added another site, how can I select, with php one site or other? 但是现在我添加了另一个站点,如何选择一个站点或其他站点?

I have checked WordPress codex, but I can only find is_main_site referring to multi-site.... does anyone has an idea about what can I use? 我已经检查了WordPress Codex,但是我只能找到is_main_site指向多站点。...有人知道我可以使用什么吗?

Thank you 谢谢

You should use a conditional function. 您应该使用条件函数。

WordPress provides the get_current_blog_id() function, using this function you can create a switch statement to add your custom footer. WordPress提供了get_current_blog_id()函数,您可以使用此函数创建一个switch语句来添加自定义页脚。

Also, you can check the get_blog_details function to retrieve the current site details. 另外,您可以检查get_blog_details函数以检索当前站点的详细信息。

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

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