2009-12-11 122 views
1

我在我的博客上看到這個錯誤,確實有一個人有同樣的錯誤?我如何解決這個錯誤? 我沒有編輯任何文件。

Notice: Undefined property: stdClass::$post_type in /home/a4673438/public_html/wp-includes/link-template.php on line 105 

    Notice: Undefined property: stdClass::$post_status in /home/a4673438/public_html/wp-includes/link-template.php on line 112 

    Notice: Undefined property: stdClass::$post_type in /home/a4673438/public_html/wp-includes/link-template.php on line 105 

    Notice: Undefined property: stdClass::$post_status in /home/a4673438/public_html/wp-includes/link-template.php on line 112 

    Notice: Undefined property: stdClass::$post_type in /home/a4673438/public_html/wp-includes/link-template.php on line 105 

    Notice: Undefined property: stdClass::$post_status in /home/a4673438/public_html/wp-includes/link-template.php on line 112 
    Notice: Undefined property: stdClass::$post_type in /home/a4673438/public_html/wp-includes/link-template.php on line 105 

    Notice: Undefined property: stdClass::$post_status in /home/a4673438/public_html/wp-includes/link-template.php on line 112 


    Notice: Undefined property: stdClass::$post_type in /home/a4673438/public_html/wp-includes/link-template.php on line 105 


    Notice: Undefined property: stdClass::$post_status in /home/a4673438/public_html/wp-includes/link-template.php on line 112 

代碼引起這種誤差 線112

if ('' != $permalink && !in_array($post->post_status, array('draft', 'pending'))) { 
    $unixtime = strtotime($post->post_date); 

線105

if ($post->post_type == 'page') 
     return get_page_link($post->ID, $leavename, $sample); 
+1

你能發佈產生這個代碼嗎?它使調試過程多一點...可能: - ] – Atli 2009-12-11 19:28:52

+0

hy謝謝,調試沒有在wp中激活,我可以但我沒有,這個輸出是當我像往常一樣調用主要index.php時產生的,我會把我的博客我的意思是 – streetparade 2009-12-11 19:33:55

+0

;我們需要查看代碼,以便我們弄清楚發生了什麼。根據錯誤消息,一個標準(大部分是空的)類正在被使用,就好像它是別的東西一樣。除此之外,我不能說真話。需要da codez :) – Atli 2009-12-11 19:41:12

回答

0

嘗試增加這些線線#100在該文件中:

if($post == null) { 
    return ''; 
} 

這可能會修復錯誤,但可能會在頁面中產生副作用。準確地說,缺少永久鏈接到您的帖子。

您使用的是什麼版本的WordPress?

+0

我使用當前2.86 – streetparade 2009-12-11 20:12:59

相關問題