$panel, 'title' => __( 'Cactus: Frontpage Sections', 'cactus' ), 'priority' => '10' ); $cactus_sections = array( 'banner' => array( 'section_name' => __( 'Section Banner', 'cactus' ), 'font_color' => '#ffffff' ), 'service' => array( 'section_name'=>__( 'Section Service', 'cactus' ), 'section_title' => '', 'section_subtitle' => '', ), 'works' => array( 'section_name'=>__( 'Section Works', 'cactus' ), 'section_title' => __( 'Our Works', 'cactus' ), 'section_subtitle' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor', ), 'promo' => array( 'section_name'=>__( 'Section Promo', 'cactus' ), 'section_title' => __( 'About', 'cactus' ), 'section_subtitle' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor', 'background_color' => '#f5f5f5' ), 'team' => array( 'section_name'=>__( 'Section Team', 'cactus' ), 'section_title' => __( 'Meet Our Team', 'cactus' ), 'section_subtitle' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor', 'background_color' => '#f5f5f5' ), 'counter' => array( 'section_name'=>__( 'Section Counter', 'cactus' ), 'section_title' => '', 'section_subtitle' => '', 'background_image' => $imagepath.'bg.jpg', 'font_color' => '#ffffff' ), 'testimonial' => array( 'section_name'=>__( 'Section Testimonials & Clients', 'cactus' ), 'section_title' => __( 'What Clients Say', 'cactus' ), 'section_subtitle' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor', 'background_color' => '#f5f5f5' ), 'news' => array( 'section_name'=>__( 'Section News', 'cactus' ), 'section_title' => __( 'Recent News', 'cactus' ), 'section_subtitle' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor', ), 'contact' => array( 'section_name'=>__( 'Section Contact', 'cactus' ), 'section_title' => __( 'Keep in Touch', 'cactus' ), 'section_subtitle' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor', ), ); foreach( $cactus_sections as $key => $value ){ /**** Section ****/ $section = 'section-'.$key; $sections[] = array( 'id' => $section, 'title' => $value['section_name'], 'priority' => '10', 'panel' => $panel ); $options['section_hide_'.$key] = array( 'id' => 'section_hide_'.$key, 'label' => __( 'Hide Section', 'cactus' ), 'section' => $section, 'type' => 'checkbox', 'default' => '', ); if( $key != 'banner' ){ $options['section_title_'.$key] = array( 'id' => 'section_title_'.$key, 'label' => __( 'Section Title', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => $value['section_title'], ); $options['section_subtitle_'.$key] = array( 'id' => 'section_subtitle_'.$key, 'label' => __( 'Section SubTitle', 'cactus' ), 'section' => $section, 'type' => 'textarea', 'default' => $value['section_subtitle'], ); } switch($key){ case "banner": $options['banner'] = array( 'id' => 'banner', 'label' => __( 'Slider', 'cactus' ), 'section' => $section, 'type' => 'repeater', 'row_label' => array( 'type' => 'field', 'value' => esc_attr__('Slide', 'cactus' ), 'field' => 'title',), 'fields' => array( 'title'=>array('type'=>'text','default'=>'','label'=> __( 'Big Title', 'cactus' )), 'subtitle'=>array('type'=>'text','default'=>'','label'=> __( 'Sub-Title', 'cactus' )), 'image'=>array('type'=>'image','default'=>'','label'=> __( 'Image', 'cactus' )), 'btn_text'=>array('type'=>'text','default'=> __( 'Learn More', 'cactus' ),'label'=> __( 'Button Text', 'cactus' )), 'btn_link'=>array('type'=>'text','default'=>'','label'=> __( 'Button Link', 'cactus' )), ), 'default' => array( array( 'title' => 'CREATE WEBSITE IN MINUTES', "subtitle" => "Just Drag & Drop. No Code or Design Skills Required.", "image" => $imagepath."bg.jpg", "btn_text" => "Learn More", "btn_link" => "#", ), ) ); break; case "service": $options['columns_'.$key] = array( 'id' => 'columns_'.$key, 'label' => __( 'Columns', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array( 2=>2,3=>3,4=>4 ), 'default' => '2' ); $options['service'] = array( 'id' => 'service', 'label' => __( 'Service', 'cactus' ), 'section' => $section, 'type' => 'repeater', 'row_label' => array( 'type' => 'field', 'value' => esc_attr__('Service', 'cactus' ), 'field' => 'title',), 'fields' => array( 'icon'=>array('type'=>'text','default'=>'','label'=> __( 'Font-awsome Icon', 'cactus' )), 'title'=>array('type'=>'text','default'=>'','label'=> __( 'Title', 'cactus' )), 'text'=>array('type'=>'textarea','default'=> '','label'=> __( 'Text', 'cactus' )), 'title_link'=>array('type'=>'text','default'=>'','label'=> __( 'Title Link', 'cactus' )), ), 'default' => array( array( "icon" => "heart-o", 'title' => 'Lorem ipsum', "text" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor, ut sollicitudin turpis. Aliquam in magna sodales, rutrum erat vel, sollicitudin quam.", "title_link" => "#", ), array( "icon" => "plane", 'title' => 'Lorem ipsum', "text" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor, ut sollicitudin turpis. Aliquam in magna sodales, rutrum erat vel, sollicitudin quam.", "title_link" => "#", ), array( "icon" => "tree", 'title' => 'Lorem ipsum', "text" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor, ut sollicitudin turpis. Aliquam in magna sodales, rutrum erat vel, sollicitudin quam.", "title_link" => "#", ), array( "icon" => "home", 'title' => 'Lorem ipsum', "text" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut egestas dolor, ut sollicitudin turpis. Aliquam in magna sodales, rutrum erat vel, sollicitudin quam.", "title_link" => "#", ), ) ); break; case "works": $options['columns_'.$key] = array( 'id' => 'columns_'.$key, 'label' => __( 'Columns', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array( 2=>2,3=>3,4=>4 ), 'default' => '4' ); $options['works'] = array( 'id' => 'works', 'label' => __( 'Works', 'cactus' ), 'section' => $section, 'type' => 'repeater', 'row_label' => array( 'type' => 'field', 'value' => esc_attr__('Work', 'cactus' ), 'field' => 'title',), 'fields' => array( 'title'=>array('type'=>'text','default'=>'','label'=> __( 'Title', 'cactus' )), 'image'=>array('type'=>'image','default'=>'','label'=> __( 'Image', 'cactus' )), 'link'=>array('type'=>'text','default'=>'','label'=> __( 'Title Link', 'cactus' )), ), 'default' => array( array( 'title' => '', "image" => $imagepath."gallery1.jpg", "link" => "#", ), array( 'title' => '', "image" => $imagepath."gallery2.jpg", "link" => "#", ), array( 'title' => '', "image" => $imagepath."gallery3.jpg", "link" => "#", ), array( 'title' => '', "image" => $imagepath."gallery4.jpg", "link" => "#", ), array( 'title' => '', "image" => $imagepath."gallery5.jpg", "link" => "#", ), array( 'title' => '', "image" => $imagepath."gallery6.jpg", "link" => "#", ), array( 'title' => '', "image" => $imagepath."gallery7.jpg", "link" => "#", ), array( 'title' => '', "image" => $imagepath."gallery8.jpg", "link" => "#", ), ) ); break; case "promo": $options['image_'.$key] = array( 'id' => 'image_'.$key, 'label' => __( 'Image', 'cactus' ), 'section' => $section, 'type' => 'image', 'default' => $imagepath.'promo1.jpg' ); $options['text_'.$key] = array( 'id' => 'text_'.$key, 'label' => __( 'Text', 'cactus' ), 'section' => $section, 'type' => 'textarea', 'default' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent pretium, ante id semper congue, metus turpis ullamcorper libero, at fringilla augue leo sed neque. Suspendisse elementum et enim in cursus. Vestibulum eget nibh dapibus, commodo magna quis, posuere risus. Sed sit amet arcu neque. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis tempus finibus risus, bibendum rhoncus augue aliquam quis. Nulla urna turpis, porta eget tristique aliquam, suscipit fringilla sem. Duis volutpat metus non elit tempor sagittis.' ); $options['button_text_'.$key] = array( 'id' => 'button_text_'.$key, 'label' => __( 'Button Text', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => __( 'Read More', 'cactus' ), ); $options['button_link_'.$key] = array( 'id' => 'button_link_'.$key, 'label' => __( 'Button Link', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => '#' ); break; case "team": $options['columns_'.$key] = array( 'id' => 'columns_'.$key, 'label' => __( 'Columns', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array( 2=>2,3=>3,4=>4 ), 'default' => '4' ); $options['team'] = array( 'id' => 'team', 'label' => __( 'Member', 'cactus' ), 'section' => $section, 'type' => 'repeater', 'row_label' => array( 'type' => 'field', 'value' => esc_attr__('Service', 'cactus' ), 'field' => 'name',), 'fields' => array( 'avatar'=>array('type'=>'image','default'=>'','label'=> __( 'Avatar', 'cactus' )), 'name'=>array('type'=>'text','default'=>'','label'=> __( 'Name', 'cactus' )), 'byline'=>array('type'=>'text','default'=> '','label'=> __( 'Byline', 'cactus' )), 'link'=>array('type'=>'text','default'=> '','label'=> __( 'Link', 'cactus' )), ), 'default' => array( array( "avatar" => $imagepath.'team1.jpg', "name" => "John Doe", "byline" => "Manager", "link" => "", ), array( "avatar" => $imagepath.'team2.jpg', "name" => "John Doe", "byline" => "Manager", "link" => "", ), array( "avatar" => $imagepath.'team3.jpg', "name" => "John Doe", "byline" => "Manager", "link" => "", ), array( "avatar" => $imagepath.'team4.jpg', "name" => "John Doe", "byline" => "Manager", "link" => "", ), ) ); break; case "counter": $options['columns_'.$key] = array( 'id' => 'columns_'.$key, 'label' => __( 'Columns', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array( 2=>2,3=>3,4=>4 ), 'default' => '4' ); $options['counter'] = array( 'id' => 'counter', 'label' => __( 'Counter', 'cactus' ), 'section' => $section, 'type' => 'repeater', 'row_label' => array( 'type' => 'field', 'value' => esc_attr__('Item', 'cactus' ), 'field' => 'title',), 'fields' => array( 'title'=>array('type'=>'text','default'=>'','label'=> __( 'Title', 'cactus' )), 'icon'=>array('type'=>'text','default'=>'','label'=> __( 'Font-awsome Icon', 'cactus' )), 'number'=>array('type'=>'text','default'=> '100','label'=> __( 'Number', 'cactus' )), ), 'default' => array( array( 'title'=> 'Themes', 'icon'=> 'heart-o', 'number'=> '20', ), array( 'title'=> 'Developers', 'icon'=> 'cogs', 'number'=> '100', ), array( 'title'=> 'Projects', 'icon'=> 'database', 'number'=> '1360', ), array( 'title'=> 'Customers', 'icon'=> 'user', 'number'=> '80000', ), ) ); break; case "testimonial": $options['testimonial'] = array( 'id' => 'testimonial', 'label' => __( 'Testimonial', 'cactus' ), 'section' => $section, 'type' => 'repeater', 'row_label' => array( 'type' => 'field', 'value' => esc_attr__('Testimonial', 'cactus' ), 'field' => 'name',), 'fields' => array( 'avatar'=>array('type'=>'image','default'=>'','label'=> __( 'Avatar', 'cactus' )), 'name'=>array('type'=>'text','default'=>'','label'=> __( 'Name', 'cactus' )), 'byline'=>array('type'=>'text','default'=> '','label'=> __( 'Byline', 'cactus' )), 'text'=>array('type'=>'textarea','default'=> '','label'=> __( 'Text', 'cactus' )), ), 'default' => array( array( "avatar" => $imagepath.'testimonial-img-1.jpg', "name" => "John Doe", "byline" => "Manager", "text" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam scelerisque ac sapien in imperdiet. Pellentesque eu venenatis erat. Nulla viverra lacus nibh. Vivamus lacinia sapien metus, non semper tortor ullamcorper non.", ), array( "avatar" => $imagepath.'testimonial-img-2.jpg', "name" => "John Doe", "byline" => "Manager", "text" => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam scelerisque ac sapien in imperdiet. Pellentesque eu venenatis erat. Nulla viverra lacus nibh. Vivamus lacinia sapien metus, non semper tortor ullamcorper non.", ), ) ); $options['clients'] = array( 'id' => 'clients', 'label' => __( 'Clients', 'cactus' ), 'section' => $section, 'type' => 'repeater', 'row_label' => array( 'type' => 'field', 'value' => esc_attr__('Client', 'cactus' ), 'field' => 'title',), 'fields' => array( 'image'=>array('type'=>'image','default'=>'','label'=> __( 'Image', 'cactus' )), 'title'=>array('type'=>'text','default'=>'','label'=> __( 'Title', 'cactus' )), 'link'=>array('type'=>'text','default'=> '#','label'=> __( 'Link', 'cactus' )), ), 'default' => array( array( "image" => $imagepath.'client1.png', "title" => "", "link" => "#", ), array( "image" => $imagepath.'client2.png', "title" => "", "link" => "#", ), array( "image" => $imagepath.'client3.png', "title" => "", "link" => "#", ), array( "image" => $imagepath.'client4.png', "title" => "", "link" => "#", ), array( "image" => $imagepath.'client1.png', "title" => "", "link" => "#", ), array( "image" => $imagepath.'client2.png', "title" => "", "link" => "#", ), ) ); break; case "news": $options['posts_num_'.$key] = array( 'id' => 'posts_num_'.$key, 'label' => __( 'Posts Num', 'cactus' ), 'section' => $section, 'default' => '3', 'type' => 'text', ); $options['news_column_'.$key] = array( 'id' => 'news_columns_'.$key, 'label' => __( 'Columns', 'cactus' ), 'section' => $section, 'default' => '3', 'type' => 'select', 'choices' => array(2=>2,3=>3,4=>4,), ); $options['button_text_'.$key] = array( 'id' => 'button_text_'.$key, 'label' => __( 'Button Text', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => __( 'View The Blog', 'cactus' ), ); $options['button_link_'.$key] = array( 'id' => 'button_link_'.$key, 'label' => __( 'Button Link', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => '#' ); break; case "contact": $options['address_'.$key] = array( 'id' => 'address_'.$key, 'label' => __( 'Address', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => __( '49 Costa Street, New York City, USA', 'cactus' ), ); $options['email_'.$key] = array( 'id' => 'email_'.$key, 'label' => __( 'Email', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => 'support@domain.com', ); $options['tel_'.$key] = array( 'id' => 'tel_'.$key, 'label' => __( 'Tel', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => '595 12 34 567', ); $options['image_'.$key] = array( 'id' => 'image_'.$key, 'label' => __( 'Image', 'cactus' ), 'section' => $section, 'type' => 'image', 'default' => $imagepath.'promo1.jpg', ); $options['google_map_address_'.$key] = array( 'id' => 'google_map_address_'.$key, 'label' => __( 'Google Map Address', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => __( '49 Costa Street, New York City, USA', 'cactus' ), ); $options['google_map_api_'.$key] = array( 'id' => 'google_map_api_'.$key, 'label' => __( 'Google Map API Key', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => '', ); $options['google_map_height_'.$key] = array( 'id' => 'google_map_height_'.$key, 'label' => __( 'Google Map Height', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => '650px', ); $options['google_map_zoom_'.$key] = array( 'id' => 'google_map_zoom_'.$key, 'label' => __( 'Google Map Zoom', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => '15', ); $options['notice_'.$key] = array( 'id' => 'notice_'.$key, 'label' => __( 'Contact From', 'cactus' ), 'section' => $section, 'type' => 'content', 'default' => '', 'description' => __( 'Install & active plugin "Cactus Companion" to enable the contact form & google map.', 'cactus' ), ); break; } $background_color = isset($value['background_color'])?$value['background_color']:'#ffffff'; $background_image = isset($value['background_image'])?$value['background_image']:''; $font_color = isset($value['font_color'])?$value['font_color']:'#555'; $options['font_color_'.$key] = array( 'id' => 'font_color_'.$key, 'label' => __( 'Font Color', 'cactus' ), 'section' => $section, 'type' => 'color', 'default' => $font_color, ); $options['background_color_'.$key] = array( 'id' => 'background_color_'.$key, 'label' => __( 'Background Color', 'cactus' ), 'section' => $section, 'type' => 'color', 'default' => $background_color, ); $options['background_image_'.$key] = array( 'id' => 'background_image_'.$key, 'label' => __( 'Background Image', 'cactus' ), 'section' => $section, 'type' => 'image', 'default' => $background_image, ); $options['section_id_'.$key] = array( 'id' => 'section_id_'.$key, 'label' => __( 'Section ID', 'cactus' ), 'section' => $section, 'type' => 'text', 'default' => $key, ); } // Panel Typography $panel = 'panel-typography'; $panels[] = array( 'id' => $panel, 'title' => __( 'Cactus: Typography', 'cactus' ), 'priority' => '11' ); $section = 'section-font-family'; $sections[] = array( 'id' => $section, 'title' => __( 'Font Family', 'cactus' ), 'priority' => '10', 'panel' => $panel ); $options['headings_font_family'] = array( 'id' => 'headings_font_family', 'label' => __( 'Headings font family', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => customizer_library_get_font_choices(), 'default' => 'Montserrat' ); $options['body_font_family'] = array( 'id' => 'body_font_family', 'label' => __( 'Body font family', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => customizer_library_get_font_choices(), 'default' => 'Montserrat' ); $section = 'section-font-size'; $sections[] = array( 'id' => $section, 'title' => __( 'Font Size', 'cactus' ), 'priority' => '11', 'panel' => $panel ); $options['body_font_size'] = array( 'id' => 'body_font_size', 'label' => __( 'Body Font Size', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array_combine(range(8,20,1), range(8,20,1)), 'default' => '14' ); $options['h1_font_size'] = array( 'id' => 'h1_font_size', 'label' => __( 'H1 Font Size', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array_combine(range(8,50,1), range(8,50,1)), 'default' => '36' ); $options['h2_font_size'] = array( 'id' => 'h2_font_size', 'label' => __( 'H2 Font Size', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array_combine(range(8,50,1), range(8,50,1)), 'default' => '30' ); $options['h3_font_size'] = array( 'id' => 'h3_font_size', 'label' => __( 'H3 Font Size', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array_combine(range(8,50,1), range(8,50,1)), 'default' => '24' ); $options['h4_font_size'] = array( 'id' => 'h4_font_size', 'label' => __( 'H4 Font Size', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array_combine(range(8,50,1), range(8,50,1)), 'default' => '20' ); $options['h5_font_size'] = array( 'id' => 'h5_font_size', 'label' => __( 'H5 Font Size', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array_combine(range(8,50,1), range(8,50,1)), 'default' => '18' ); $options['h6_font_size'] = array( 'id' => 'h6_font_size', 'label' => __( 'H6 Font Size', 'cactus' ), 'section' => $section, 'type' => 'select', 'choices' => array_combine(range(8,50,1), range(8,50,1)), 'default' => '16' ); // Panel Footer $section = 'panel-footer'; $sections[] = array( 'id' => $section, 'title' => __( 'Cactus: Footer Options', 'cactus' ), 'priority' => '12' ); $options['display_footer_widgets'] = array( 'id' => 'display_footer_widgets', 'label' => __( 'Display Footer Widgets', 'cactus' ), 'section' => $section, 'type' => 'checkbox', 'default' => '1', ); $options['footer_logo'] = array( 'id' => 'footer_logo', 'label' => __( 'Footer Logo', 'cactus' ), 'section' => $section, 'type' => 'image', 'default' => $imagepath.'logo.png', ); $options['display_footer_icons'] = array( 'id' => 'display_footer_icons', 'label' => __( 'Display Footer Icons', 'cactus' ), 'section' => $section, 'type' => 'checkbox', 'default' => '1', ); $options['footer_icons'] = array( 'id' => 'footer_icons', 'label' => __( 'Footer Icons', 'cactus' ), 'section' => $section, 'type' => 'repeater', 'row_label' => array( 'type' => 'field', 'value' => esc_attr__('Icon', 'cactus' ), 'field' => 'title',), 'fields' => array( 'icon'=>array('type'=>'text','default'=>'','label'=> __( 'Font-awesome Icon', 'cactus' )), 'title'=>array('type'=>'text','default'=>'','label'=> __( 'Title', 'cactus' )), 'link'=>array('type'=>'text','default'=> '#','label'=> __( 'Link', 'cactus' )), ), 'default' => array( array( "icon" => 'twitter', "title" => "", "link" => "#", ), array( "icon" => 'facebook', "title" => "", "link" => "#", ), array( "icon" => 'instagram', "title" => "", "link" => "#", ), array( "icon" => 'google-plus', "title" => "", "link" => "#", ), array( "icon" => 'youtube', "title" => "", "link" => "#", ), ) ); $new_options = array(); foreach( $options as $option ){ if( isset($option['default']) ){ $cactus_default_sections[$option['id']] = $option['default']; $key = CACTUS_TEXTDOMAIN.'['.$option['id'].']'; $option['id'] = $key; $new_options[$key] = $option; } } // Adds the sections to the $options array $new_options['sections'] = $sections; // Adds the panels to the $options array $new_options['panels'] = $panels; $customizer_library = Customizer_Library::Instance(); $customizer_library->add_options( $new_options ); } add_action( 'init', 'cactus_customizer_library_options' );