• Resolved Ariful Islam Shaon

    (@shaonbd2020)


    I’m using this https://www.ads-software.com/plugins/option-tree/ plugin.

    I can add single option type in a single section. but I need to add more then one types in a single section. How do I do this?

    Assume that, I have a section named ‘links’ and I need 5 social links, 3 button links. When I add single type in a single it works fine, but my problem is for multiple. I cannot figure it out.

    Please see my ‘links’ section below and give me a solution.

    add_action( 'admin_init', 'custom_theme_options', 1 );
    
    function custom_theme_options() {
    
      $custom_settings = array(
        'sections'        => array(
          array(
            'id'          => 'logo',
            'title'       => 'Logo Settings'
          ),
          array(
            'id'          => 'notice',
            'title'       => 'Notice Message'
          ),
          array(
            'id'          => 'links',
            'title'       => 'Links Settings'
          ),
        ),
        'settings'        => array(
          array(
            'id'          => 'logo_uploader',
            'label'       => 'Upload Logo Here:',
            'desc'        => 'Maximum Size: Width 195px and Height 55px',
            'type'        => 'upload',
            'section'     => 'logo'
          ),
          array(
            'id'          => 'notice_board',
            'label'       => 'Notice Board Message',
            'type'        => 'textarea',
            'section'     => 'notice'
          ),
          array(
            'id'          => 'links_settings',
            'label'       => 'All Links Settings',
            'desc'        => 'All links setting to this website goes here',
            'section'     => 'links',
    	'type'        => 'text',
          )
        )
      );
    
      if ( $saved_settings !== $custom_settings ) {
        update_option( 'option_tree_settings', $custom_settings );
      }
    
    }
  • The topic ‘How to I add multiple options 'type' in a single section in Option Tree Plugin?’ is closed to new replies.