AI助手支持GPT4.0
ul>
Add this code in your functions.php.
将此代码添加到您的 functions.php em>中。 p>global $default_theme_pages; global $ default_theme_pages;$default_theme_pages = array( $ default_theme_pages =数组( array( 数组( 'name' => 'home', // initial slug page / id for templating - access functions 'name'=>'home',//用于模板的初始子页面/ id-访问功能 'title' => 'Homepage', // page title 'title'=>'Homepage',//页面标题 'option' => 'page_on_front', // option page id ( stores the page id in an option, use only in theese cases) 'option'=>'page_on_front',//选项页面ID(将页面ID存储在选项中,仅在这些情况下使用) 'description' => 'homepage' // description 'description'=>'主页'//说明 ), ), array( 数组( 'name' => 'blog', '名称'=>'博客', 'title' => 'Blog', '标题'=>'博客', 'option' => 'page_for_posts', 'option'=>'page_for_posts', 'description' => 'blog' '描述'=>'博客' ), ), array( 数组( 'name' => 'contact', '名称'=>'联系人', 'title' => 'Contact me!', 'title'=>'与我联系!', 'description' => 'Contact form page' '说明'=>'联系表格页面' ) ) );); code> pre>Tips提示 h4>After the pages are created automatically, you can change their title and slug without problem.自动创建页面后,您可以毫无问题地更改其标题和标签。 li>If you add an option names: page_on_front and page_for_posts, you will block the home-page and如果添加 option code>名称: page_on_front code>和 page_for_posts code>,则会阻止首页 em>和the blog-page on your site.您网站上的博客页面 em>。 li> ul>Templating模板化 h4>You can template using ID or name (setted up in $default_theme_pages global variable ), something like:您可以使用 ID strong>或名称 strong>(在$ default_theme_pages全局变量中设置)进行模板化,例如: p>page-131.php or page-contact.php (If you change the page slug, this will still work because 'contact' was defined as page-131.php strong>或 page-contact.php strong>(如果更改页面信息,由于“ contact”被定义为 pagename if $default_theme_pages global variable).pagename em>(如果是$ default_theme_pages全局变量)。 p>For detect if you’re in that page:要检测您是否在该页面中: p>dtp_is_page('contact') dtp_is_page('contact') code> pre>Getting a default page id:获取默认页面ID: p>$page_id = dtp_get_page_id('contact'); $ page_id = dtp_get_page_id('contact'); code> pre>This method is more quick than get_page_by_path because page ID is stored on global variable.此方法比 get_page_by_path em>更快,因为页面ID存储在全局变量中。 p>
global $default_theme_pages; global $ default_theme_pages;$default_theme_pages = array( $ default_theme_pages =数组( array( 数组( 'name' => 'home', // initial slug page / id for templating - access functions 'name'=>'home',//用于模板的初始子页面/ id-访问功能 'title' => 'Homepage', // page title 'title'=>'Homepage',//页面标题 'option' => 'page_on_front', // option page id ( stores the page id in an option, use only in theese cases) 'option'=>'page_on_front',//选项页面ID(将页面ID存储在选项中,仅在这些情况下使用) 'description' => 'homepage' // description 'description'=>'主页'//说明 ), ), array( 数组( 'name' => 'blog', '名称'=>'博客', 'title' => 'Blog', '标题'=>'博客', 'option' => 'page_for_posts', 'option'=>'page_for_posts', 'description' => 'blog' '描述'=>'博客' ), ), array( 数组( 'name' => 'contact', '名称'=>'联系人', 'title' => 'Contact me!', 'title'=>'与我联系!', 'description' => 'Contact form page' '说明'=>'联系表格页面' ) ) );); code> pre>Tips提示 h4>After the pages are created automatically, you can change their title and slug without problem.自动创建页面后,您可以毫无问题地更改其标题和标签。 li>If you add an option names: page_on_front and page_for_posts, you will block the home-page and如果添加 option code>名称: page_on_front code>和 page_for_posts code>,则会阻止首页 em>和the blog-page on your site.您网站上的博客页面 em>。 li> ul>Templating模板化 h4>You can template using ID or name (setted up in $default_theme_pages global variable ), something like:您可以使用 ID strong>或名称 strong>(在$ default_theme_pages全局变量中设置)进行模板化,例如: p>page-131.php or page-contact.php (If you change the page slug, this will still work because 'contact' was defined as page-131.php strong>或 page-contact.php strong>(如果更改页面信息,由于“ contact”被定义为 pagename if $default_theme_pages global variable).pagename em>(如果是$ default_theme_pages全局变量)。 p>For detect if you’re in that page:要检测您是否在该页面中: p>dtp_is_page('contact') dtp_is_page('contact') code> pre>Getting a default page id:获取默认页面ID: p>$page_id = dtp_get_page_id('contact'); $ page_id = dtp_get_page_id('contact'); code> pre>This method is more quick than get_page_by_path because page ID is stored on global variable.此方法比 get_page_by_path em>更快,因为页面ID存储在全局变量中。 p>
global $ default_theme_pages;$default_theme_pages = array( $ default_theme_pages =数组( array( 数组( 'name' => 'home', // initial slug page / id for templating - access functions 'name'=>'home',//用于模板的初始子页面/ id-访问功能 'title' => 'Homepage', // page title 'title'=>'Homepage',//页面标题 'option' => 'page_on_front', // option page id ( stores the page id in an option, use only in theese cases) 'option'=>'page_on_front',//选项页面ID(将页面ID存储在选项中,仅在这些情况下使用) 'description' => 'homepage' // description 'description'=>'主页'//说明 ), ), array( 数组( 'name' => 'blog', '名称'=>'博客', 'title' => 'Blog', '标题'=>'博客', 'option' => 'page_for_posts', 'option'=>'page_for_posts', 'description' => 'blog' '描述'=>'博客' ), ), array( 数组( 'name' => 'contact', '名称'=>'联系人', 'title' => 'Contact me!', 'title'=>'与我联系!', 'description' => 'Contact form page' '说明'=>'联系表格页面' ) ) ););
$default_theme_pages = array(
$ default_theme_pages =数组(
array(
数组(
'name' => 'home', // initial slug page / id for templating - access functions
'name'=>'home',//用于模板的初始子页面/ id-访问功能
'title' => 'Homepage', // page title
'title'=>'Homepage',//页面标题
'option' => 'page_on_front', // option page id ( stores the page id in an option, use only in theese cases)
'option'=>'page_on_front',//选项页面ID(将页面ID存储在选项中,仅在这些情况下使用)
'description' => 'homepage' // description
'description'=>'主页'//说明
),
),
'name' => 'blog',
'名称'=>'博客',
'title' => 'Blog',
'标题'=>'博客',
'option' => 'page_for_posts',
'option'=>'page_for_posts',
'description' => 'blog'
'描述'=>'博客'
'name' => 'contact',
'名称'=>'联系人',
'title' => 'Contact me!',
'title'=>'与我联系!',
'description' => 'Contact form page'
'说明'=>'联系表格页面'
)
)
);
);
code> pre>
option
page_on_front
page_for_posts
option code>名称: page_on_front code>和 page_for_posts code>,则会阻止首页 em>和the blog-page on your site.
page_on_front code>和 page_for_posts code>,则会阻止首页 em>和the blog-page on your site.
page_for_posts code>,则会阻止首页 em>和the blog-page on your site.
the blog-page on your site.
您网站上的博客页面 em>。 li>
You can template using ID or name (setted up in $default_theme_pages global variable ), something like:
您可以使用 ID strong>或名称 strong>(在$ default_theme_pages全局变量中设置)进行模板化,例如: p>page-131.php or page-contact.php (If you change the page slug, this will still work because 'contact' was defined as page-131.php strong>或 page-contact.php strong>(如果更改页面信息,由于“ contact”被定义为 pagename if $default_theme_pages global variable).pagename em>(如果是$ default_theme_pages全局变量)。 p>For detect if you’re in that page:要检测您是否在该页面中: p>dtp_is_page('contact') dtp_is_page('contact') code> pre>Getting a default page id:获取默认页面ID: p>$page_id = dtp_get_page_id('contact'); $ page_id = dtp_get_page_id('contact'); code> pre>This method is more quick than get_page_by_path because page ID is stored on global variable.此方法比 get_page_by_path em>更快,因为页面ID存储在全局变量中。 p>
page-131.php or page-contact.php (If you change the page slug, this will still work because 'contact' was defined as page-131.php strong>或 page-contact.php strong>(如果更改页面信息,由于“ contact”被定义为 pagename if $default_theme_pages global variable).pagename em>(如果是$ default_theme_pages全局变量)。 p>For detect if you’re in that page:要检测您是否在该页面中: p>dtp_is_page('contact') dtp_is_page('contact') code> pre>Getting a default page id:获取默认页面ID: p>$page_id = dtp_get_page_id('contact'); $ page_id = dtp_get_page_id('contact'); code> pre>This method is more quick than get_page_by_path because page ID is stored on global variable.此方法比 get_page_by_path em>更快,因为页面ID存储在全局变量中。 p>
page-131.php strong>或 page-contact.php strong>(如果更改页面信息,由于“ contact”被定义为 pagename if $default_theme_pages global variable).
pagename
pagename em>(如果是$ default_theme_pages全局变量)。 p>
For detect if you’re in that page:
要检测您是否在该页面中: p>
dtp_is_page('contact') dtp_is_page('contact') code> pre>Getting a default page id:获取默认页面ID: p>$page_id = dtp_get_page_id('contact'); $ page_id = dtp_get_page_id('contact'); code> pre>This method is more quick than get_page_by_path because page ID is stored on global variable.此方法比 get_page_by_path em>更快,因为页面ID存储在全局变量中。 p>
dtp_is_page('contact')
Getting a default page id:
获取默认页面ID: p>
$page_id = dtp_get_page_id('contact'); $ page_id = dtp_get_page_id('contact'); code> pre>This method is more quick than get_page_by_path because page ID is stored on global variable.此方法比 get_page_by_path em>更快,因为页面ID存储在全局变量中。 p>
$ page_id = dtp_get_page_id('contact');
This method is more quick than get_page_by_path because page ID is stored on global variable.
此方法比 get_page_by_path em>更快,因为页面ID存储在全局变量中。 p>
原文出处:http://www.sanshu.cn/a/10478.html
群主管理都是支付大佬