【发布时间】:2017-02-21 03:42:52
【问题描述】:
我在自定义的 BuddyPress 小部件 (latest-articles.php) 中有一段代码,它落在 => 部分上,并将之后的所有内容输出到屏幕上。这是代码部分:
$infohub_args = array(
'post_type' => array('article','post'),
'posts_per_page' => 8,
'order' => 'DESC',
'post_status' => 'publish'
);
$infohub_loop = new WP_Query($infohub_args);
这是输出到屏幕而不是小部件内容的内容:
array('article','post'), 'posts_per_page' => 8, 'order' => 'DESC', 'post_status' => 'publish' ); $infohub_loop = 新的 WP_Query($infohub_args); */ $post_max = 8; $all_post = 数组(); $article_cat = get_terms(array('taxonomy' => 'articles', 'hide_empty' => true ));
基本上'=>'部分之后的所有内容都会显示在屏幕上。
这是 PHP 配置或版本问题吗?
这是在 Windows 10 / IIS 10 机器上。
【问题讨论】:
-
Í 不要认为这是 php 配置或短标签的问题(doc php.net/manual/en/language.basic-syntax.phptags.php),因为 php 结束标签必须是 '?>' 以检查 '=>' 之间的任何空格
-
short_open_tag 已关闭,在 php.ini 中对其进行了更新,现在可以使用:
-
short_open_tag = 开启
-
非常感谢 - 发表您的评论作为答案,我会将其标记为完成。
标签: php wordpress buddypress