2010-08-24 6 views
0

Может ли кто-нибудь помочь мне добавить поле для загрузки изображений. Вот мой текущий код!Wordpress: custom_post_type Загрузка изображения

add_action('init', 'pictures_portofolio'); 

function pictures_portofolio() { 
    $args = array(
     'label' => __('Bilder'), 
     'singular_label' => __('Bilder'), 
     'public' => true, 
     'show_ui' => true, 
     'capability_type' => 'post', 
     'hierarchical' => false, 
     'rewrite' => true, 
     'supports' => array(false) 
    ); 

    register_post_type('Bilder' , $args); 
} 


add_action("admin_init", "admin_init"); 
add_action('save_post', 'save_the_post'); 

function admin_init(){ 
    register_taxonomy("catalog", array("product"), array("hierarchical" => true, "label" => "Kategorien", "singular_label" => "Kategorien", "rewrite" => true)); 

} 


function save_the_post(){ 
    global $post; 
    //update_post_meta($post->ID, "price", $_POST["price"]); 
} 

ответ

0

насчет установки:

'supports' => array('thumbnail') 

... И ваша тема должна поддерживать эскизы слишком; поместите это в свои функции темы. php

add_theme_support('post-thumbnails', array('Bilder')); 

Надеюсь, это поможет!

http://codex.wordpress.org/Function_Reference/add_theme_support

+0

Я хочу, чтобы иметь возможность загружать несколько изображений одновременно – Uffo

Смежные вопросы