wordpress博客首页静态的方法如下:
首先新建一个php文件,文字可以自取,自己要记住,比如index-html.php,然后复制以下代码:
<?php$baseCmsUrl="https://www.ziyouwu.com";$dmPageName="index.php";$stPageName="index.html";$tureStFile=dirname(__FILE__).'/'.$stPageName;{$body=file_get_contents($baseCmsUrl.'/'.$dmPageName);$fp=fopen($tureStFile,'w');fwrite($fp,$body);fclose($fp);}if(file_exists("index.html")){unlink("index.html");}$baseCmsUrl="https://www.ziyouwu.com";$dmPageName="index.php";$stPageName="index.html";$tureStFile=dirname(__FILE__).'/'.$stPageName;{$body=file_get_contents($baseCmsUrl.'/'.$dmPageName);$fp=fopen($tureStFile,'w');fwrite($fp,$body);fclose($fp);}header("Location:$baseCmsUrl/index.html");?>