How can I adjust the size of the height in a Wysiwyg box

2

I need to use Custom Post Types and learned how to in this article . However, this article does not teach you how to insert Custom Post Types into Pages and how to leave <textarea> in Wysiwyg format. What I need:

  • Leave it textearea in Wysiwyg and still determine the height size height . Example: 100px , I do not want it big, because it will be written little, and it's 3 text box.

  • Remove the main content, or leave only Custom Post Types, remove the textearea that Wordpress already comes by default.

  • Code functions.php used to include Custom Post Types in Pages:

    add_action("admin_init", "admin_init");
    
    function admin_init(){
      add_meta_box("credits_meta", "Design & Build Credits", "credits_meta", "page", "normal", "low");
    }
    
    function credits_meta() {
      global $post;
      $custom = get_post_custom($post->ID);
      $designers = $custom["designers"][0];
      $developers = $custom["developers"][0];
      $producers = $custom["producers"][0];
      ?>
      <p><label>Designed By:</label><br />
      <textarea cols="50" rows="5" name="designers"><?php echo $designers; ?></textarea></p>
      <p><label>Built By:</label><br />
      <textarea cols="50" rows="5" name="developers"><?php echo $developers; ?></textarea></p>
      <p><label>Produced By:</label><br />
      <textarea cols="50" rows="5" name="producers"><?php echo $producers; ?></textarea></p>
      <?php
    }
    

    I even found the code to insert a text box into Wysiwyg, but how can I adjust the size of the height?

    $content = '';
    $editor_id = 'mycustomeditor';
    wp_editor( $content, $editor_id );
    
        
    asked by anonymous 17.02.2014 / 18:29

    2 answers

    1

    The function wp_editor( $content, $editor_id, $settings = array() ) has a third parameter that has the setting you need, textarea_rows .

    The default values are:

    $settings = array(
        'wpautop' => true,                     // use wpautop?
        'media_buttons' => true,               // show insert/upload button(s)
        'textarea_name' => $editor_id,         // set the textarea name to something different, square brackets [] can be used here
        'textarea_rows' => 20,
        'tabindex' => '',
        'tabfocus_elements' => ':prev,:next',  // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE
        'editor_css' => '',                    // intended for extra styles for both visual and Text editors buttons, needs to include the <style> tags, can use "scoped".
        'editor_class' => '',                  // add extra class(es) to the editor textarea
        'teeny' => false,                      // output the minimal editor config used in Press This
        'dfw' => false,                        // replace the default fullscreen with DFW (needs specific DOM elements and css)
        'tinymce' => true,                     // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
        'quicktags' => true                    // load Quicktags, can be used to pass settings directly to Quicktags using an array()
    ) );
    
        
    12.03.2014 / 01:26
    0

    I would recommend using the Advanced Custom Fields module, it simplifies this process and works well.

    With it you can create specific fields (like in your case, a testo field with Wysiwyg) and associate it with a content type. The way to create specific templates follows the standard of wordpress as single- {post-type} .php

    link to module link

        
    17.02.2014 / 21:14