This article has been synchronized to the professional technical website www.shluqu.cn , which focuses on front-end and back-end development technology and experience sharing, including web development, Nodejs, Python, Linux, IT information and other sections.
Use the link provided by the Baidu webmaster platform to automatically submit the code, quickly increase Baidu’s inclusion, and speed up the crawling of website content.
1. Create a file named “baidu_js_push.php” with the following content (automatically push JS code):
< script >
( function (){
var bp = document . createElement ( 'script' );
var curProtocol = window . location . protocol . split ( ':' )[ 0 ];
if (curProtocol === 'https' ) {
bp. src = 'https ://zz.bdstatic.com/linksubmit/push.js' ;
} else {
bp. src = 'http://push.zhanzhang.baidu.com/push.js' ;
} var s =
document . getElementsByTagName ( "script" )[ 0 ];
s. parentNode . insertBefore (bp, s);
})();
</ script >
2. Upload the baidu_js_push.php file to the website root directory (wordpress root directory).
3. Add the following code to the footer.php file of the theme file to achieve the effect of one installation and the whole site.
<?php include_once ( "baidu_js_push.php" ) ?>
related articles