2013-10-21 38 views
1

我正在使用名爲特斯拉的免費模板。它有一個很好的投資組合自定義帖子,但它不允許你以豐富的形式編輯文本。我的客戶正在尋找一個富文本編輯器,並且該模板適合其需求,但他不想手動添加中斷,粗體等。如何將wp_edit(富文本)添加到此自定義文章中?

它是在聲明文本的teslawp_porftolio中,我如何打開wp_edit?或者,有沒有其他方法可以添加富文本?

<?php 

return array(

'teslawp_main' => array(
    'name' => 'Main Slider', 
    'term' => 'slide', 
    'term_plural' => 'slides', 
    'order' => 'ASC', 
    'options' => array(
     'description' => array(
      'type' => 'text', 
      'description' => 'Enter description of the slide', 
      'title' => 'Description', 
     ), 
     'image' => array(
      'type' => 'image', 
      'description' => 'Image of the slide', 
      'title' => 'Image', 
      'default' => 'holder.js/960x407/auto' 
     ), 
     'url' => array(
      'type' => 'line', 
      'description' => '(Optional) URL applied to the title', 
      'title' => 'URL', 
      'default' => '' 
     ) 
    ), 
    'output_default' => 'main', 
    'output' => array(
     'main' => array(
      'shortcode' => 'tesla_main_slider', 
      'view' => 'views/main_slider_view', 
      'shortcode_defaults' => array(
       'style' => '', 
       'speed' => 4, 
       'pause' => 8, 
       'toggle_caption' => true 
      ) 
     ) 
    ), 
    'icon' => '../images/favicon.png' 
), 
'teslawp_clients' => array(
    'name' => 'Clients Slider', 
    'term' => 'slide', 
    'term_plural' => 'slides', 
    'order' => 'ASC', 
    'options' => array(
     'image' => array(
      'type' => 'image', 
      'description' => 'Image of the slide', 
      'title' => 'Image', 
      'default' => 'holder.js/144x65/auto' 
     ), 
     'url' => array(
      'type' => 'line', 
      'description' => '(Optional) URL for the image', 
      'title' => 'URL', 
      'default' => '' 
     ) 
    ), 
    'output_default' => 'main', 
    'output' => array(
     'main' => array(
      'shortcode' => 'tesla_clients_slider', 
      'view' => 'views/clients_slider_view', 
      'shortcode_defaults' => array(
       'title' => __('our clients','teslawp'), 
       'style' => 'style' 
      ) 
     ) 
    ), 
    'icon' => '../images/favicon.png' 
), 
'teslawp_secondary' => array(
    'name' => 'Secondary Slider', 
    'term' => 'slide', 
    'term_plural' => 'slides', 
    'order' => 'ASC', 
    'options' => array(
     'image' => array(
      'type' => 'image', 
      'description' => 'Image of the slide', 
      'title' => 'Image', 
      'default' => 'holder.js/682x330/auto' 
     ) 
    ), 
    'output_default' => 'main', 
    'output' => array(
     'main' => array(
      'shortcode' => 'tesla_secondary_slider', 
      'view' => 'views/secondary_slider_view', 
      'shortcode_defaults' => array(
       'style' => '', 
       'speed' => 4, 
       'pause' => 8 
      ) 
     ) 
    ), 
    'icon' => '../images/favicon.png' 
), 

'teslawp_portfolio' => array(
    'name' => 'Portfolio', 
    'term' => 'portfolio item', 
    'term_plural' => 'portfolio items', 
    'has_single' => true, 
    'order' => 'DESC', 
    'options' => array(
     'small_description' => array(
      'type' => 'text', 
      'description' => 'Breve descripción (mostrada en el home)', 
      'title' => 'Breve descripción (mostrada en el home)', 
     ), 

     'full_description' => array(
      'type' => 'text', 
      'description' => 'Objetivo del programa (mostrado en la página del programa). Favor de usar HTML.', 
      'title' => 'Objetivo del programa (mostrado en la página del programa). Favor de usar HTML.', 
     ), 
     'small_image' => array(
      'type' => 'image', 
      'description' => 'Imagen de 240x240px que se mostrará en el home.', 
      'title' => 'Imagen de 240x240px que se mostrará en el home.', 
      'default' => 'holder.js/240x240/auto' 
     ), 

     'informacion' => array(
      'type' => 'text', 
      'description' => 'Información completa del programa. Favor de usar HTML.', 
      'title' => 'Información completa del programa. Favor de usar HTML.', 
     ), 

     'image_slider' => array(
      'type' => 'image', 
      'description' => 'Slider dentro de la página del programa.', 
      'title' => 'Slider dentro de la página del programa.', 
      'default' => 'holder.js/627x330/auto', 
      'multiple' => true 
     ), 
     'categories' => array(
      'type' => 'line', 
      'description' => 'Fecha en la que se realizará el curso.', 
      'title' => 'Fecha en la que se realizará el curso.', 
      'default' => '' 
     ), 
     'skills' => array(
      'type' => 'line', 
      'description' => 'Precio del curso.', 
      'title' => 'Precio del curso.', 
      'default' => '' 

     ) 
    ), 
    'output_default' => 'main', 
    'output' => array(
     'main' => array(
      'shortcode' => 'tesla_portfolio', 
      'view' => 'views/portfolio_view', 
      'shortcode_defaults' => array(
       'no_more' => false 
      ) 
     ), 
     'single' => array(
      'view' => 'views/portfolio_single_view', 
      'shortcode_defaults' => array(
       'style' => '', 
       'speed' => 4, 
       'pause' => 8 
      ) 
     ) 
    ), 
    'icon' => '../images/favicon.png' 
), 
'teslawp_testimonial' => array(
    'name' => 'Testimonials', 
    'term' => 'testimonial', 
    'term_plural' => 'testimonials', 
    'order' => 'ASC', 
    'options' => array(
     'testimonial' => array(
      'type' => 'text', 
      'description' => 'Enter text of the testimonial', 
      'title' => 'Testimonial', 
     ), 
     'image' => array(
      'type' => 'image', 
      'description' => 'Author\'s image', 
      'title' => 'Author\' Image', 
      'default' => 'holder.js/126x126/auto' 
     ), 
     'author' => array(
      'type' => 'line', 
      'description' => 'Author of the testimonial (Ex. John Doe)', 
      'title' => 'Author\'s Name', 
      'default' => '' 
     ), 
     'url' => array(
      'type' => 'line', 
      'description' => '(Optional) url to the author\'s page', 
      'title' => 'Author\'s Url', 
      'default' => '' 
     ) 
    ), 
    'output_default' => 'main', 
    'output' => array(
     'main' => array(
      'shortcode' => 'tesla_testimonial', 
      'view' => 'views/testimonial_view', 
      'shortcode_defaults' => array(
       'wide' => true, 
       'class' => '', 
       'speed' => 4, 
       'pause' => 8 
      ) 
     ) 
    ), 
    'icon' => '../images/favicon.png' 
) 

);

回答

0

因此,對於帖子類型顯示豐富的編輯器,您只需要在帖子類型中添加帖子內容字段('編輯器')屬性。

如果顯示的是內容字段,但不是編輯器,可能是您切換到了源代碼編輯器。它可以在這裏切換: toggle HTML and CODE

但是,如果帖子類型不顯示文本區域,則需要修改帖子類型。在這種情況下,它將是:

add_post_type_support('post_type_name', array('editor')) 

希望它有幫助。

+1

謝謝SidGBF,但是,我不知道在添加的較大代碼中添加那段代碼的位置。你能不能指出我正確的方向? –

+0

當然!這段代碼被添加到主題的functions.php中的任何地方。如果你允許我建議,創建一個兒童主題(http://codex.wordpress.org/Child_Themes),並在這個主題的functions.php中只添加該行。使用兒童主題可以在更新時保護您。 – SidFerreira

相關問題