Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在我选择的时间段内刷新wordpress插件?_Php_Wordpress - Fatal编程技术网

Php 如何在我选择的时间段内刷新wordpress插件?

Php 如何在我选择的时间段内刷新wordpress插件?,php,wordpress,Php,Wordpress,我为wordpress写了一个插件,我希望它每3小时刷新一次,但我没有得到任何结果 谢谢你的帮助 您可以尝试使用javascript: setTimeout(function(){ window.location = 'example.com' },10800) 让我们知道您在3个半小时左右的时间内进展如何…您已经混淆了PHPheader()函数和HTML HEAD部分 PHP标题('Location:newpage.htm')执行到newpage.htm的即时重定向(并应直接在调用die()

我为wordpress写了一个插件,我希望它每3小时刷新一次,但我没有得到任何结果


谢谢你的帮助

您可以尝试使用javascript:

setTimeout(function(){ window.location = 'example.com' },10800)

让我们知道您在3个半小时左右的时间内进展如何…

您已经混淆了PHP
header()
函数和HTML HEAD部分

PHP
标题('Location:newpage.htm')执行到newpage.htm的即时重定向(并应直接在调用
die()
之后)。没有可能延迟重定向

在HTML
部分,您可以使用元标记执行延迟刷新或重定向:

<!-- Refresh the Current Page every 10 minutes (600 seconds) //-->
<meta http-equiv="refresh" content="600">

<!-- Redirect to Another Page with a Delay of 10 minutes (600 seconds) //-->
<meta http-equiv="refresh" content="600;url=http://anotherserver.com/">