Title: [Plugin: OptionTree] Problem adding customised list-items
Last modified: August 20, 2016

---

# [Plugin: OptionTree] Problem adding customised list-items

 *  Resolved [WAXFROGDESIGN](https://wordpress.org/support/users/waxfrogdesign/)
 * (@waxfrogdesign)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-adding-customised-list-items/)
 * I’m using the latest v2.0.8 and have installed option tree into the theme folder.
   I’m currently trying to setup List-Items in a meta box.
 * **When I add the following code, the list item works fine. **
 *     ```
       $standardpage = array(
   
          'id'          => 'sp',
           'title'       => 'Main Content',
           'desc'        => '',
           'pages'       => array( 'page' ),
           'context'     => 'normal',
           'priority'    => 'high',
           'fields'      => array(
             array(
               'label'       => 'Content',
               'id'          => 'sp_content',
               'type'        => 'list-item',
               'desc'        => 'Example Text',
               'settings'    => array(
   
                 array(
                   'label'       => 'Subtitle',
                   'id'          => 'sp_subtitle',
                   'type'        => 'text',
                   'desc'        => 'Example text',
                   'std'         => '',
                   'rows'        => '',
                   'post_type'   => '',
                   'taxonomy'    => '',
                   'class'       => ''
                 ) 
   
               ),
               'std'         => '',
               'rows'        => '',
               'post_type'   => '',
               'taxonomy'    => '',
               'class'       => ''
             )
            )
           );
         ot_register_meta_box( $standardpage );
       ```
   
 * **However, when I try and add another field, for example …it defaults to Title,
   Image, Link, description and does not use my custom fields**
 *     ```
       $standardpage = array(
   
          'id'          => 'sp',
           'title'       => 'Main Content',
           'desc'        => '',
           'pages'       => array( 'page' ),
           'context'     => 'normal',
           'priority'    => 'high',
           'fields'      => array(
             array(
               'label'       => 'Content',
               'id'          => 'sp_content',
               'type'        => 'list-item',
               'desc'        => 'Example Text',
               'settings'    => array(
   
                 array(
                   'label'       => 'Subtitle',
                   'id'          => 'sp_subtitle',
                   'type'        => 'text',
                   'desc'        => 'Example text',
                   'std'         => '',
                   'rows'        => '',
                   'post_type'   => '',
                   'taxonomy'    => '',
                   'class'       => ''
                 ), 
   
                 array(
                   'label'       => 'Example',
                   'id'          => 'examplefield',
                   'type'        => 'text',
                   'desc'        => 'Example text',
                   'std'         => '',
                   'rows'        => '',
                   'post_type'   => '',
                   'taxonomy'    => '',
                   'class'       => ''
                 ) 
   
               ),
               'std'         => '',
               'rows'        => '',
               'post_type'   => '',
               'taxonomy'    => '',
               'class'       => ''
             )
            )
           );
         ot_register_meta_box( $standardpage );
       ```
   
 * Any ideas? I think it does this in the theme options too.
 * [http://wordpress.org/extend/plugins/option-tree/](http://wordpress.org/extend/plugins/option-tree/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-adding-customised-list-items/#post-2914539)
 *     ```
       /**
        * Initialize the meta boxes.
        */
       add_action( 'admin_init', 'custom_meta_boxes' );
   
       function custom_meta_boxes() {
   
         $my_meta_box = array(
           'id'        => 'my_meta_box',
           'title'     => 'Image Slider',
           'desc'      => '',
           'pages'     => array( 'post' ),
           'context'   => 'normal',
           'priority'  => 'high',
           'fields'    => array(
             array(
               'id'          => 'slides',
               'label'       => 'Slides',
               'desc'        => '',
               'std'         => '',
               'type'        => 'list-item',
               'class'       => '',
               'choices'     => array(),
               'settings'    => array(
                 array(
                   'label'       => 'Subtitle',
                   'id'          => 'sp_subtitle',
                   'type'        => 'text',
                   'desc'        => 'Example text',
                   'std'         => '',
                   'rows'        => '',
                   'post_type'   => '',
                   'taxonomy'    => '',
                   'class'       => ''
                 ),
                 array(
                   'label'       => 'Example',
                   'id'          => 'examplefield',
                   'type'        => 'text',
                   'desc'        => 'Example text',
                   'std'         => '',
                   'rows'        => '',
                   'post_type'   => '',
                   'taxonomy'    => '',
                   'class'       => ''
                 )
               )
             ),
             array(
               'id'          => 'taxonomy_select',
               'label'       => 'Taxonomy Select',
               'desc'        => '',
               'std'         => '',
               'type'        => 'taxonomy-select',
               'taxonomy'    => 'category,post_tag',
               'class'       => '',
               'choices'     => array()
             ),
             array(
               'id'          => 'list_item',
               'label'       => 'List Item',
               'desc'        => '',
               'std'         => '',
               'type'        => 'list-item',
               'taxonomy'    => '',
               'class'       => '',
               'choices'     => array()
             )
         	)
         );
   
         ot_register_meta_box( $my_meta_box );
   
       }
       ```
   
 * I tested this code and it works fine for me.
 *  Thread Starter [WAXFROGDESIGN](https://wordpress.org/support/users/waxfrogdesign/)
 * (@waxfrogdesign)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-adding-customised-list-items/#post-2914552)
 * Strange, when I add your code I still get the default Title, Image, Link and 
   description instead of what you have given me above! Not sure what’s overriding
   it.
 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-adding-customised-list-items/#post-2914553)
 * There are two list items in that code are you checking both of them?
 *  Thread Starter [WAXFROGDESIGN](https://wordpress.org/support/users/waxfrogdesign/)
 * (@waxfrogdesign)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-adding-customised-list-items/#post-2914557)
 * Yes. Both are doing the default.
 * I can give you access to my ftp / wordpress install.
 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-adding-customised-list-items/#post-2914558)
 * Send the details to derek[at]valendesigns.com
 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-adding-customised-list-items/#post-2914564)
 * Found a solution, I’ll add it into the next version. For whatever reason your
   server didn’t want to pass large strings in the GET variable, I’ve switched it
   to POST and everything is working as expected. i’ll do some more testing locally
   to verify and then get it out ASAP.
 *  Thread Starter [WAXFROGDESIGN](https://wordpress.org/support/users/waxfrogdesign/)
 * (@waxfrogdesign)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-adding-customised-list-items/#post-2914565)
 * Thanks very much Derek and for giving me your time!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: OptionTree] Problem adding customised list-items’ is closed 
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/option-tree_363534.svg)
 * [OptionTree](https://wordpress.org/plugins/option-tree/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/option-tree/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/option-tree/)
 * [Active Topics](https://wordpress.org/support/plugin/option-tree/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/option-tree/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/option-tree/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [WAXFROGDESIGN](https://wordpress.org/support/users/waxfrogdesign/)
 * Last activity: [13 years, 9 months ago](https://wordpress.org/support/topic/plugin-optiontree-problem-adding-customised-list-items/#post-2914565)
 * Status: resolved