2012-12-09 52 views
2

由於今天上午,我試圖知道爲什麼這個錯誤在我的WordPress新鮮安裝。 當我嘗試在帖子預覽中放置圖像時,它會添加。 預覽不起作用,因爲該網址是壞的SRC上getimagesize()和basename()錯誤wordpress

<img src="http://myname.com/wp-content/uploads/2012/12/" width="" height="" style="position: absolute; opacity: 0;"/> 

Apache2的日誌:

[Sun Dec 09 15:54:44 2012] [error] PHP Warning: getimagesize() expects parameter 1 to be string, object given in /var/www/wordpress/wp-content/themes/montezuma/includes/thumb.php on line 222 
[Sun Dec 09 15:54:44 2012] [error] PHP Warning: basename() expects parameter 1 to be string, object given in /var/www/wordpress/wp-content/themes/montezuma/includes/thumb.php on line 223 

我的PHP版本: PHP 5.3.3-7 + squeeze14用了Suhosin-補丁(CLI)

我的WordPress版本: 版本3.4.2

線在thumb.php:

220     // no cache files - let's finally resize it 
221     $new_img_path = image_resize($file_path, $width, $height, $crop); 
222     $new_img_size = getimagesize($new_img_path); 
223     $new_img = str_replace(basename($image_src[0]), basename($new_img_path), $image_src[0]); 

任何想法?

+0

我敢打賭,這是你的主題的問題。你在第222和223行的'/ var/www/wordpress/wp-content/themes/montezuma/includes/thumb.php'裏有什麼? –

+0

在這種情況下,它不是Wordpress有這個問題,但你正在使用的主題。您將不得不嘗試追蹤主題調用thumb.php的位置以執行縮略圖,或者檢查主題作者的網站是否存在任何已知問題。 – drew010

+0

你有沒有找到解決方案,可以請你分享一下嗎?我也有同樣的問題。 – MNilson

回答

0

我找到了解決我的完全相同的問題。

上傳圖片需要至少900px寬。