加載的wordpress後我試圖檢索使用其ID的WordPress的帖子的內容:錯誤,同時使用ID
$loadpost = url_to_postid($actual_link);
$newpost = get_post($loadpost);
echo '<article id="post-'.$newpost["ID"].'"><h1>'.$newpost["post_title"].'</h1>'.$newpost["post_content"];
$ loadpost返回一個有效的ID,但不知何故這個表達式不起作用。 IE返回:
Fatal error: Cannot use object of type stdClass as array in /hermes/waloraweb046/b428/moo.snippetspacecom/splittemplate/wp-content/themes/split/index.php on line 24
這是什麼意思?
感謝您的幫助球員。
http://stackoverflow.com/questions/6171699/cannot-use-object-of-type-stdclass-as-array-using-wordpress – anuragbh