我最近將兩個網站的Wordpress網絡從本地MAMP服務器遷移到了在線網站。除了Post-Thumbnail的功能之外,所有內容都完美地遷移。元框不會出現在任何網站中,也不會出現在整個網絡的任何主題中。文章縮略圖Metabox不會在Wordpress Network上出現
我已經測試了幾個不同的主題,啓用後縮略圖,結果是一樣的。沒有metabox是可見的!我很難過,有沒有人有建議?
的網站之一的functions.php文件是:
if(function_exists('add_theme_support')) {
add_theme_support('post-thumbnails', array('page', 'post', 'portfolio'));
/** Register custom size */
add_image_size('page-image', 620, 620, false);
add_image_size('portfolio-image', 795, 575, true);
add_image_size('portfolio-thumbnail', 135, 94, true);
}
//------enable post thumbnail preview for custom columns
if (!function_exists('fb_AddThumbColumn') && function_exists('add_theme_support')) {
// for post and investments
function fb_AddThumbColumn($cols) {
$cols['thumbnail'] = __('Thumbnail');
return $cols;
}
function fb_AddThumbValue($column_name, $post_id) {
$width = (int) 200;
$height = (int) 125;
if ('thumbnail' == $column_name) {
// thumbnail of WP 2.9
$thumbnail_id = get_post_meta($post_id, '_thumbnail_id', true);
// image from gallery
$attachments = get_children(array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image'));
if ($thumbnail_id)
$thumb = wp_get_attachment_image($thumbnail_id, array($width, $height), true);
elseif ($attachments) {
foreach ($attachments as $attachment_id => $attachment) {
$thumb = wp_get_attachment_image($attachment_id, array($width, $height), true);
}
}
if (isset($thumb) && $thumb) {
echo $thumb;
} else {
echo __('None');
}
}
}
// for posts
add_filter('manage_posts_columns', 'fb_AddThumbColumn');
add_action('manage_posts_custom_column', 'fb_AddThumbValue', 10, 2);
// for portfolio
add_filter('manage_portfolio_columns', 'fb_AddThumbColumn');
add_action('manage_portfolio_custom_column', 'fb_AddThumbValue', 10, 2);
}
*/
function the_post_thumbnail_url($post_id) {
echo wp_get_attachment_url(get_post_thumbnail_id($post_id));
}
任何想法如何在WP 3.5.1中做到這一點? 我的全部問題:http://stackoverflow.com/questions/16932529/post-thumbnail-metabox-doesnt-appear-on-customposttype-from-childtheme – lippoliv 2013-06-06 10:11:30