Title: Custom Option Types
Last modified: August 22, 2016

---

# Custom Option Types

 *  Resolved [igid26](https://wordpress.org/support/users/igid26/)
 * (@igid26)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/custom-option-types/)
 * Hi,
    I use Option Tree Custom Option Types. I’m trying to insert in theme color
   picker with opacity and Spacing. For Spacing I used code.
 *     ```
       if ( function_exists( 'ot_get_option' ) ) {
         /* get the array, and have a default just incase */
         $color_opacity = ot_get_option( 'color_opacity', array( '10', 'px' ) );
   
         /* implode array into a string value */
         if ( ! empty( color_opacity ) ) {
           echo implode( '', $color_opacity );
         }
   
       }
       ```
   
 * But it display padding along. example: padding: 510510px
    I need padding: 5px
   5px 10px 10px. I also need the code for color opacity
 * Sorry for my English.
 * [https://wordpress.org/plugins/option-tree/](https://wordpress.org/plugins/option-tree/)

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

 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/custom-option-types/#post-5728169)
 * What is the array output of `color_opacity` when there are multiple values?
 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/custom-option-types/#post-5728171)
 * If it’s just an array like `array( '5', '10', '5', '10' )` then the code would
   be:
 *     ```
       if ( function_exists( 'ot_get_option' ) ) {
         /* get the array, and have a default just incase */
         $color_opacity = ot_get_option( 'color_opacity', array( '10' ) );
   
         /* implode array into a string value */
         if ( ! empty( color_opacity ) ) {
           echo implode( 'px ', $color_opacity );
         }
   
       }
       ```
   
 *  Thread Starter [igid26](https://wordpress.org/support/users/igid26/)
 * (@igid26)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/custom-option-types/#post-5728239)
 * Thank you for answering
 * The code works but if is in settings theme specified value px or % do not working.
   Because it shows the value: padding: 5px 5px 10px 10px px; or 5px 5px 10px 10px%;.
   Last px or% must be deleted. When the value of px in the settings theme code 
   works correctly.
 *  Thread Starter [igid26](https://wordpress.org/support/users/igid26/)
 * (@igid26)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/custom-option-types/#post-5728412)
 * How do I add the code into css? For example for class flex-title.
    Thanks
 *  Plugin Author [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * (@valendesigns)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/custom-option-types/#post-5728508)
 * Is this still an issue for you or have you figured it out?

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

 The topic ‘Custom Option Types’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [Derek Herman](https://wordpress.org/support/users/valendesigns/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/custom-option-types/#post-5728508)
 * Status: resolved