我为我的代码保持错误" 解析错误:语法错误,第13行的文件意外结束 "...如下所示
<?php
$all= get_posts(array('post_type' => 'books', 'numberposts' => -1,));
foreach ( $all as $post ) : setup_postdata($post);
if (!empty($post))
{
$postid=$post->ID;
echo $postid;
}
?>
Run Code Online (Sandbox Code Playgroud)
你忘了结束你的 foreach
<?php
$all= get_posts(array('post_type' => 'books', 'numberposts' => -1,));
foreach ( $all as $post ) : setup_postdata($post);
if (!empty($post))
{
$postid=$post->ID;
echo $postid;
}
endforeach;
?>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
169 次 |
| 最近记录: |