Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/238.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 一个职位内职位的人力资源时间_Php_Wordpress - Fatal编程技术网

Php 一个职位内职位的人力资源时间

Php 一个职位内职位的人力资源时间,php,wordpress,Php,Wordpress,我正在使用一个插件,它将一些帖子从一个标签分组到另一个帖子中。我想在这些帖子中添加人的时间,但我在下面使用的方法只是调用父帖子的时间 if ($date) { $output .= __('on ', 'posts-by-tag'); $output .= mysql2date(get_option('date_format'), $post->post_date) . ' at ' ; $output .= mysql2date(get_option('t

我正在使用一个插件,它将一些帖子从一个标签分组到另一个帖子中。我想在这些帖子中添加人的时间,但我在下面使用的方法只是调用父帖子的时间

if ($date) { 
    $output .=  __('on ', 'posts-by-tag');
    $output .=  mysql2date(get_option('date_format'), $post->post_date) . ' at ' ;
    $output .=  mysql2date(get_option('time_format'), $post->post_date) . '<span class="the-times">' ;
    $output .=  human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago</span></p></div>' ;
如果($date){
$output.=_u;('on','posts by tag');
$output.=mysql2date(get_选项('date_格式'),$post->post_日期)。'at';
$output.=mysql2date(get_选项('time_格式'),$post->post_日期)。“”;
$output.=human_time_diff(获取_时间('U')、当前_时间('timestamp'))。'ago

';
中间的两个输出正常工作,只有最后一个不正常。要使最后一个输出正常工作,需要对其进行哪些更改?我猜这与$post->有关,但我不确定正确的结构。

如果这不在“循环”中您必须在
get\u the\u time
函数中以post id为目标,如下所示:

    $output .=  human_time_diff(get_the_time('U',$post->id), current_time('timestamp')) . ' ago</span></p></div>' ;
$output.=human_time_diff(获取_时间('U',$post->id),当前_时间('timestamp')。'ago

';