AI助手支持GPT4.0
Here is a useful method you should use any where you need it dnas_get_post_ID().
dnas_get_post_ID()
这是一种有用的方法,您应该在需要的任何地方使用它 dnas_get_post_ID() code>。 p>It returns the post ID (if any) related to the current domain name.它返回与当前域名相关的帖子ID(如果有)。For instance, if you would like to display URL of the fake home page: 例如,如果您想显示假主页的URL: p>You can check the plugin development on github.您可以在 github 上检查插件的开发。 p>Pros: 优点: strong> p>since the plugin does not modify nor use your .htaccess file,因为该插件不会修改或使用您的 .htaccess code>文件,it works with every permalink formats.它适用于每种永久链接格式。 li>allow you to manage your domain names directly through your允许您直接通过管理域名post edit forms.发布编辑表单。 li> ul>Cons: 缺点: strong> p>since it hacks the query variables, some template tags like is_home()因为它入侵了查询变量,所以一些模板标记(例如 is_home() code> could not work as expected if a dedicated domain name is triggered.如果触发了专用域名,则无法按预期工作。 li>be aware there is no conflict support: you can fill the same domain请注意,不存在冲突支持:您可以填写相同的域for several posts.几个职位。Only a single one will win the game, without没有,只有一个人会赢得比赛any control from your part (but it will be easy to see which one have您所拥有的任何控件(但很容易看出其中哪个控件to be checked… if you ever notice it).进行检查……如果您注意到了)。Be careful!小心! li> ul>Configuration配置 h4>The plugin works with both custom post types and classic post type.插件既可以使用自定义帖子类型,也可以使用经典帖子类型 strong>。You have to edit a configuration file in order to indicate on which您必须编辑配置文件以指示在哪个上posts the plugin should add its domain name field.发布插件应添加其域名字段。You can indicate您可以指出Categorie identifiers or/and Post Types slugs.类别标识符或/和帖子类型 strong>。For instance, to make例如,使the plugin showing its domain field on any posts of the categories #4插件在类别#4 的任何帖子上显示其domain字段and #8, then:和#8,然后: p>$dnas_categories_ID = array( 4, 8 ); $ dnas_categories_ID = array(4,8); code> pre>Dependency依赖性 h4>The Advanced Custom Fields 高级自定义字段 plugin is required.插件是必需的。 p>License许可证 h4>This program is free software.该程序是免费软件。It comes without any warranty, to它没有任何保修,the extent permitted by applicable law.适用法律允许的范围。You can redistribute it您可以重新分发and/or modify it under the terms of the Do What The Fuck You Want和/或根据做您想做的事的条款进行修改To Public License, Version 2,公开许可,版本2 ,as published by Sam Hocevar.由Sam Hocevar发布。See (http://www.wtfpl.net/) for more details.有关更多详细信息,请参见(http://www.wtfpl.net/)。 p>
dnas_get_post_ID() code>。 p>It returns the post ID (if any) related to the current domain name.它返回与当前域名相关的帖子ID(如果有)。For instance, if you would like to display URL of the fake home page: 例如,如果您想显示假主页的URL: p>You can check the plugin development on github.您可以在 github 上检查插件的开发。 p>Pros: 优点: strong> p>since the plugin does not modify nor use your .htaccess file,因为该插件不会修改或使用您的 .htaccess code>文件,it works with every permalink formats.它适用于每种永久链接格式。 li>allow you to manage your domain names directly through your允许您直接通过管理域名post edit forms.发布编辑表单。 li> ul>Cons: 缺点: strong> p>since it hacks the query variables, some template tags like is_home()因为它入侵了查询变量,所以一些模板标记(例如 is_home() code> could not work as expected if a dedicated domain name is triggered.如果触发了专用域名,则无法按预期工作。 li>be aware there is no conflict support: you can fill the same domain请注意,不存在冲突支持:您可以填写相同的域for several posts.几个职位。Only a single one will win the game, without没有,只有一个人会赢得比赛any control from your part (but it will be easy to see which one have您所拥有的任何控件(但很容易看出其中哪个控件to be checked… if you ever notice it).进行检查……如果您注意到了)。Be careful!小心! li> ul>Configuration配置 h4>The plugin works with both custom post types and classic post type.插件既可以使用自定义帖子类型,也可以使用经典帖子类型 strong>。You have to edit a configuration file in order to indicate on which您必须编辑配置文件以指示在哪个上posts the plugin should add its domain name field.发布插件应添加其域名字段。You can indicate您可以指出Categorie identifiers or/and Post Types slugs.类别标识符或/和帖子类型 strong>。For instance, to make例如,使the plugin showing its domain field on any posts of the categories #4插件在类别#4 的任何帖子上显示其domain字段and #8, then:和#8,然后: p>$dnas_categories_ID = array( 4, 8 ); $ dnas_categories_ID = array(4,8); code> pre>Dependency依赖性 h4>The Advanced Custom Fields 高级自定义字段 plugin is required.插件是必需的。 p>License许可证 h4>This program is free software.该程序是免费软件。It comes without any warranty, to它没有任何保修,the extent permitted by applicable law.适用法律允许的范围。You can redistribute it您可以重新分发and/or modify it under the terms of the Do What The Fuck You Want和/或根据做您想做的事的条款进行修改To Public License, Version 2,公开许可,版本2 ,as published by Sam Hocevar.由Sam Hocevar发布。See (http://www.wtfpl.net/) for more details.有关更多详细信息,请参见(http://www.wtfpl.net/)。 p>
It returns the post ID (if any) related to the current domain name.
它返回与当前域名相关的帖子ID(如果有)。
For instance, if you would like to display URL of the fake home page:
例如,如果您想显示假主页的URL:
p>
You can check the plugin development on github.
您可以在 github 上检查插件的开发。 p>
Pros:
优点: strong> p>since the plugin does not modify nor use your .htaccess file,因为该插件不会修改或使用您的 .htaccess code>文件,it works with every permalink formats.它适用于每种永久链接格式。 li>allow you to manage your domain names directly through your允许您直接通过管理域名post edit forms.发布编辑表单。 li> ul>Cons: 缺点: strong> p>since it hacks the query variables, some template tags like is_home()因为它入侵了查询变量,所以一些模板标记(例如 is_home() code> could not work as expected if a dedicated domain name is triggered.如果触发了专用域名,则无法按预期工作。 li>be aware there is no conflict support: you can fill the same domain请注意,不存在冲突支持:您可以填写相同的域for several posts.几个职位。Only a single one will win the game, without没有,只有一个人会赢得比赛any control from your part (but it will be easy to see which one have您所拥有的任何控件(但很容易看出其中哪个控件to be checked… if you ever notice it).进行检查……如果您注意到了)。Be careful!小心! li> ul>Configuration配置 h4>The plugin works with both custom post types and classic post type.插件既可以使用自定义帖子类型,也可以使用经典帖子类型 strong>。You have to edit a configuration file in order to indicate on which您必须编辑配置文件以指示在哪个上posts the plugin should add its domain name field.发布插件应添加其域名字段。You can indicate您可以指出Categorie identifiers or/and Post Types slugs.类别标识符或/和帖子类型 strong>。For instance, to make例如,使the plugin showing its domain field on any posts of the categories #4插件在类别#4 的任何帖子上显示其domain字段and #8, then:和#8,然后: p>$dnas_categories_ID = array( 4, 8 ); $ dnas_categories_ID = array(4,8); code> pre>Dependency依赖性 h4>The Advanced Custom Fields 高级自定义字段 plugin is required.插件是必需的。 p>License许可证 h4>This program is free software.该程序是免费软件。It comes without any warranty, to它没有任何保修,the extent permitted by applicable law.适用法律允许的范围。You can redistribute it您可以重新分发and/or modify it under the terms of the Do What The Fuck You Want和/或根据做您想做的事的条款进行修改To Public License, Version 2,公开许可,版本2 ,as published by Sam Hocevar.由Sam Hocevar发布。See (http://www.wtfpl.net/) for more details.有关更多详细信息,请参见(http://www.wtfpl.net/)。 p>
.htaccess
.htaccess code>文件,it works with every permalink formats.
it works with every permalink formats.
它适用于每种永久链接格式。 li>
post edit forms.
发布编辑表单。 li>
ul>
Cons:
缺点: strong> p>since it hacks the query variables, some template tags like is_home()因为它入侵了查询变量,所以一些模板标记(例如 is_home() code> could not work as expected if a dedicated domain name is triggered.如果触发了专用域名,则无法按预期工作。 li>be aware there is no conflict support: you can fill the same domain请注意,不存在冲突支持:您可以填写相同的域for several posts.几个职位。Only a single one will win the game, without没有,只有一个人会赢得比赛any control from your part (but it will be easy to see which one have您所拥有的任何控件(但很容易看出其中哪个控件to be checked… if you ever notice it).进行检查……如果您注意到了)。Be careful!小心! li> ul>Configuration配置 h4>The plugin works with both custom post types and classic post type.插件既可以使用自定义帖子类型,也可以使用经典帖子类型 strong>。You have to edit a configuration file in order to indicate on which您必须编辑配置文件以指示在哪个上posts the plugin should add its domain name field.发布插件应添加其域名字段。You can indicate您可以指出Categorie identifiers or/and Post Types slugs.类别标识符或/和帖子类型 strong>。For instance, to make例如,使the plugin showing its domain field on any posts of the categories #4插件在类别#4 的任何帖子上显示其domain字段and #8, then:和#8,然后: p>$dnas_categories_ID = array( 4, 8 ); $ dnas_categories_ID = array(4,8); code> pre>Dependency依赖性 h4>The Advanced Custom Fields 高级自定义字段 plugin is required.插件是必需的。 p>License许可证 h4>This program is free software.该程序是免费软件。It comes without any warranty, to它没有任何保修,the extent permitted by applicable law.适用法律允许的范围。You can redistribute it您可以重新分发and/or modify it under the terms of the Do What The Fuck You Want和/或根据做您想做的事的条款进行修改To Public License, Version 2,公开许可,版本2 ,as published by Sam Hocevar.由Sam Hocevar发布。See (http://www.wtfpl.net/) for more details.有关更多详细信息,请参见(http://www.wtfpl.net/)。 p>
is_home()
is_home() code> could not work as expected if a dedicated domain name is triggered.
could not work as expected if a dedicated domain name is triggered.
如果触发了专用域名,则无法按预期工作。 li>
for several posts.
几个职位。
Only a single one will win the game, without
没有,只有一个人会赢得比赛
any control from your part (but it will be easy to see which one have
您所拥有的任何控件(但很容易看出其中哪个控件
to be checked… if you ever notice it).
进行检查……如果您注意到了)。
Be careful!
小心! li>
The plugin works with both custom post types and classic post type.
插件既可以使用自定义帖子类型,也可以使用经典帖子类型 strong>。You have to edit a configuration file in order to indicate on which您必须编辑配置文件以指示在哪个上posts the plugin should add its domain name field.发布插件应添加其域名字段。You can indicate您可以指出Categorie identifiers or/and Post Types slugs.类别标识符或/和帖子类型 strong>。For instance, to make例如,使the plugin showing its domain field on any posts of the categories #4插件在类别#4 的任何帖子上显示其domain字段and #8, then:和#8,然后: p>$dnas_categories_ID = array( 4, 8 ); $ dnas_categories_ID = array(4,8); code> pre>Dependency依赖性 h4>The Advanced Custom Fields 高级自定义字段 plugin is required.插件是必需的。 p>License许可证 h4>This program is free software.该程序是免费软件。It comes without any warranty, to它没有任何保修,the extent permitted by applicable law.适用法律允许的范围。You can redistribute it您可以重新分发and/or modify it under the terms of the Do What The Fuck You Want和/或根据做您想做的事的条款进行修改To Public License, Version 2,公开许可,版本2 ,as published by Sam Hocevar.由Sam Hocevar发布。See (http://www.wtfpl.net/) for more details.有关更多详细信息,请参见(http://www.wtfpl.net/)。 p>
You have to edit a configuration file in order to indicate on which
您必须编辑配置文件以指示在哪个上
posts the plugin should add its domain name field.
发布插件应添加其域名字段。
You can indicate
您可以指出
Categorie identifiers or/and Post Types slugs.
类别标识符或/和帖子类型 strong>。For instance, to make例如,使the plugin showing its domain field on any posts of the categories #4插件在类别#4 的任何帖子上显示其domain字段and #8, then:和#8,然后: p>$dnas_categories_ID = array( 4, 8 ); $ dnas_categories_ID = array(4,8); code> pre>Dependency依赖性 h4>The Advanced Custom Fields 高级自定义字段 plugin is required.插件是必需的。 p>License许可证 h4>This program is free software.该程序是免费软件。It comes without any warranty, to它没有任何保修,the extent permitted by applicable law.适用法律允许的范围。You can redistribute it您可以重新分发and/or modify it under the terms of the Do What The Fuck You Want和/或根据做您想做的事的条款进行修改To Public License, Version 2,公开许可,版本2 ,as published by Sam Hocevar.由Sam Hocevar发布。See (http://www.wtfpl.net/) for more details.有关更多详细信息,请参见(http://www.wtfpl.net/)。 p>
For instance, to make
例如,使
the plugin showing its domain field on any posts of the categories #4
插件在类别#4 的任何帖子上显示其domain字段
and #8, then:
和#8,然后: p>
$dnas_categories_ID = array( 4, 8 ); $ dnas_categories_ID = array(4,8); code> pre>Dependency依赖性 h4>The Advanced Custom Fields 高级自定义字段 plugin is required.插件是必需的。 p>License许可证 h4>This program is free software.该程序是免费软件。It comes without any warranty, to它没有任何保修,the extent permitted by applicable law.适用法律允许的范围。You can redistribute it您可以重新分发and/or modify it under the terms of the Do What The Fuck You Want和/或根据做您想做的事的条款进行修改To Public License, Version 2,公开许可,版本2 ,as published by Sam Hocevar.由Sam Hocevar发布。See (http://www.wtfpl.net/) for more details.有关更多详细信息,请参见(http://www.wtfpl.net/)。 p>
$ dnas_categories_ID = array(4,8);
code> pre>
The Advanced Custom Fields
高级自定义字段
plugin is required.
插件是必需的。 p>
This program is free software.
该程序是免费软件。
It comes without any warranty, to
它没有任何保修,
the extent permitted by applicable law.
适用法律允许的范围。
You can redistribute it
您可以重新分发
and/or modify it under the terms of the Do What The Fuck You Want和/或根据做您想做的事的条款进行修改To Public License, Version 2,公开许可,版本2 ,
和/或根据做您想做的事的条款进行修改To Public License, Version 2,
To Public License, Version 2
公开许可,版本2
as published by Sam Hocevar.
由Sam Hocevar发布。
See (http://www.wtfpl.net/) for more details.
有关更多详细信息,请参见(http://www.wtfpl.net/)。 p>
/wp-content/plugins/
/ wp-content / plugins / code>。 li>In the plugin directory, edit the following file: 在插件目录中,编辑以下文件: sample-domain-name-autoswitch-config.php.样本域名自动切换配置.php。 li>Then, rename the config file to: domain-name-autoswitch-config.php.然后,将配置文件重命名为: domain-name-autoswitch-config.php code>。 li>Activate the plugin through the WordPress Plugins admin page.通过WordPress插件管理页面激活插件。 li>Set up your domain names like you want to, directly through the直接通过设置所需的域名posts’ edit pages.帖子的编辑页面。 li>Obviously, you will have to set up your virtual hosts (ServerAlias很显然,您必须设置虚拟主机( ServerAlias code> directives), so every domain names you want to use are pointing to指令),因此您要使用的每个域名都指向your WordPress instance.您的WordPress实例。 li>
sample-domain-name-autoswitch-config.php.
样本域名自动切换配置.php。 li>
domain-name-autoswitch-config.php
domain-name-autoswitch-config.php code>。 li>Activate the plugin through the WordPress Plugins admin page.通过WordPress插件管理页面激活插件。 li>Set up your domain names like you want to, directly through the直接通过设置所需的域名posts’ edit pages.帖子的编辑页面。 li>Obviously, you will have to set up your virtual hosts (ServerAlias很显然,您必须设置虚拟主机( ServerAlias code> directives), so every domain names you want to use are pointing to指令),因此您要使用的每个域名都指向your WordPress instance.您的WordPress实例。 li>
posts’ edit pages.
帖子的编辑页面。 li>
ServerAlias
ServerAlias code> directives), so every domain names you want to use are pointing to指令),因此您要使用的每个域名都指向your WordPress instance.
directives), so every domain names you want to use are pointing to
指令),因此您要使用的每个域名都指向
your WordPress instance.
您的WordPress实例。 li>
ol>
原文出处:http://www.sanshu.cn/a/11400.html
群主管理都是支付大佬