WordPress基础教程:在主题中显示后台添加的ICP备案号

前端之家收集整理的这篇文章主要介绍了WordPress基础教程:在主题中显示后台添加的ICP备案号前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

wordpress 自 3.7 版本以后,增加后台备案号的设置,查看网站根目录中的 wp-config.php 文件,一般会看到 define(‘WP_ZH_CN_ICP_NUM’,true); 这个定义,这个就是用来设置后台备案号的。如果您的 wordpress 版本在 3.7 以上,而且 wp-config.php 含有 define(‘WP_ZH_CN_ICP_NUM’,true); 就可以在 wordpress 后台中的 设置 – 常规 中看到此配置选项,如下图:

icp

遗憾的是这个“ICP备案号”仅支持wordpress自带主题,站长朋友们在使用的过程中,大多数使用的是第三方WordPress主题。这篇里,我们就向大家介绍一下方法在自己的主题显示 wordpress 后台添加的ICP备案号。

切换到主题目录,打开 footer.PHP 文件,加入以下代码

Crayon-5c891ce47b17a629977714" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">footer.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-mixed-highlight" title="Contains Mixed Languages">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891ce47b17a629977714-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891ce47b17a629977714-2">2
Crayon-num" data-line="Crayon-5c891ce47b17a629977714-3">3
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891ce47b17a629977714-1">Crayon-o"><Crayon-i">aCrayon-h"> Crayon-v">hrefCrayon-o">=Crayon-s">"http://www.miitbeian.gov.cn/"Crayon-h"> Crayon-v">relCrayon-o">=Crayon-s">"external nofollow"Crayon-h"> Crayon-v">targetCrayon-o">=Crayon-s">"_blank"
Crayon-line Crayon-striped-line" id="Crayon-5c891ce47b17a629977714-2">Crayon-h"> Crayon-ta">PHPCrayon-h"> Crayon-k ">echoCrayon-h"> Crayon-e">get_optionCrayon-sy">(Crayon-h"> Crayon-s">'zh_cn_l10n_icp_num'Crayon-h"> Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891ce47b17a629977714-3">Crayon-o"><Crayon-o">/Crayon-v">a

注意:上面的代码中,显示wordpress 后台添加的ICP备案号了,并且点击的时候回链接到工信部网站。如果您不需要链接到工信部网站,只需添加下面的代码即可:

Crayon-5c891ce47b183761623823" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">functions.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-mixed-highlight" title="Contains Mixed Languages">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891ce47b183761623823-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891ce47b183761623823-1">Crayon-ta">PHPCrayon-h"> Crayon-k ">echoCrayon-h"> Crayon-e">get_optionCrayon-sy">(Crayon-h"> Crayon-s">'zh_cn_l10n_icp_num'Crayon-h"> Crayon-sy">)Crayon-sy">;

原文链接:https://www.f2er.com/wordpress/238405.html

猜你在找的wordpress相关文章