簡體   English   中英

WordPress和BuddyPress將PHP輸出到頁面

[英]WordPress & BuddyPress Outputting PHP to page

我在一個自定義的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 = array(); $ article_cat = get_terms(array('taxonomy'=>'articles','hide_empty'=> true));

基本上,'=>'部分之后的所有內容都會顯示在屏幕上。

這是PHP配置或版本問題嗎?

這是在Windows 10 / IIS 10計算機上。

在那里您不會允許短標簽<? (不鼓勵這樣做,因為只有在使用short_open_tag php.ini配置文件指令啟用此功能時,或者如果使用--enable-short-tags選項配置了PHP,該功能才可用)。

請參閱doc http://php.net/manual/en/language.basic-syntax.phptags.php

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM