我必须在我的wordpress博客的自定义模板页面中显示2篇文章,但此代码没有显示任何内容.
$myposts = get_posts("numberposts=2&category=3");
foreach($myposts as $post) : the_content(); endforeach;
Run Code Online (Sandbox Code Playgroud)
但如果我试着,print_r($myposts);我可以说有一个数组..我可以解决这个问题吗?非常感谢
小智 6
写这一行:
the_post();
Run Code Online (Sandbox Code Playgroud)
在使用之前:
the_content();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4794 次 |
| 最近记录: |