Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function rambo_home_page_customizer( $wp_customize ) {
- /* Header Section */
- $wp_customize->add_panel( 'home_page_setting', array(
- 'capability' => 'edit_theme_options',
- 'priority' => 250,
- 'title' => __('Home Page Settings', 'rambo'),
- ) );
- $wp_customize->add_section(
- 'slider_section_settings',
- array(
- 'title' => __('Slider Setting','rambo'),
- 'description' => '',
- 'panel' => 'home_page_setting',)
- );
- //Hide slider
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[home_slider_enabled]',
- array(
- 'default' => true,
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[home_slider_enabled]',
- array(
- 'label' => __('Enable slider on front page','rambo'),
- 'section' => 'slider_section_settings',
- 'type' => 'checkbox',
- 'priority' => 100,
- ));
- //Slider animation
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[animation]',
- array(
- 'default' => __('slide','rambo'),
- 'type' => 'option',
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[animation]',
- array(
- 'type' => 'select',
- 'label' => __('Select slider Animation','rambo'),
- 'section' => 'slider_section_settings',
- 'priority' => 200,
- 'choices' => array('slide'=>__('slide', 'rambo'), 'fade'=>__('fade', 'rambo')),
- ));
- //Slider animation
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[slide_direction]',
- array(
- 'default' => __('slide','rambo'),
- 'type' => 'option',
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[slide_direction]',
- array(
- 'type' => 'select',
- 'label' => __('Slide direction','rambo'),
- 'section' => 'slider_section_settings',
- 'priority' => 250,
- 'choices' => array('horizontal'=>__('horizontal', 'rambo'), 'vertical'=>__('vertical', 'rambo')),
- ));
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[slideshowSpeed]',
- array(
- 'default' => __('2000','rambo'),
- 'type' => 'option',
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[slideshowSpeed]',
- array(
- 'type' => 'select',
- 'label' => __('Animation speed','rambo'),
- 'section' => 'slider_section_settings',
- 'priority' => 300,
- 'choices' => array('500'=>'0.5','1000'=>'1.0','1500'=>'1.5','2000' => '2.0','2500' => '2.5' ,'3000' =>'3.0' , '3500' => '3.5', '4000' => '4.0','4500' => '4.5' ,'5000' => '5.0' , '5500' => '5.5' )));
- // Slide show speed
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[slideshowSpeed]',
- array(
- 'default' => __('2500','rambo'),
- 'type' => 'option',
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[slideshowSpeed]',
- array(
- 'type' => 'select',
- 'label' => __('Slideshow speed','rambo'),
- 'section' => 'slider_section_settings',
- 'priority' => 300,
- 'choices' => array('500'=>'0.5','1000'=>'1.0','1500'=>'1.5','2000' => '2.0','2500' => '2.5' ,'3000' =>'3.0' , '3500' => '3.5', '4000' => '4.0','4500' => '4.5' ,'5000' => '5.0' , '5500' => '5.5' )));
- //Add Slider setting
- class WP_slider_Customize_Control extends WP_Customize_Control {
- public $type = 'new_menu';
- /**
- * Render the control's content.
- */
- public function render_content() {
- ?>
- <a href="<?php bloginfo ( 'url' );?>/wp-admin/post-new.php?post_type=rambopro_slider" class="button" target="_blank"><?php _e( 'Click Here To Add Slider', 'rambo' ); ?></a>
- <?php
- }
- }
- $wp_customize->add_setting(
- 'slider',
- array(
- 'default' => __('','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- $wp_customize->add_control( new WP_slider_Customize_Control( $wp_customize, 'slider', array(
- 'section' => 'slider_section_settings',
- 'priority' => 500,
- ))
- );
- $wp_customize->add_section( 'site_intro' , array(
- 'title' => __('Site Intro ', 'rambo'),
- 'panel' => 'home_page_setting',
- ) );
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[site_intro_descritpion]',
- array(
- 'default' => __('Rambo is a clean and fully responsive Template.','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option'
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[site_intro_descritpion]',
- array(
- 'label' => __('Intro description','rambo'),
- 'section' => 'site_intro',
- 'type' => 'textarea',
- )
- );
- //Site intro call now
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[site_intro_button_text]',
- array(
- 'default' => __('Purchase Now','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option'
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[site_intro_button_text]',
- array(
- 'label' => __('Intro button text','rambo'),
- 'section' => 'site_intro',
- 'type' => 'text',
- )
- );
- //Button Link
- $wp_customize ->add_setting (
- 'rambo_pro_theme_options[site_intro_button_link]',
- array(
- 'default' => __('#','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- ) );
- $wp_customize->add_control (
- 'rambo_pro_theme_options[site_intro_button_link]',
- array (
- 'label' => __('Intro button link','rambo'),
- 'section' => 'site_intro',
- 'type' => 'text',
- ) );
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[intro_button_target]',
- array('capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- ));
- $wp_customize->add_control(
- 'rambo_pro_theme_options[intro_button_target]',
- array(
- 'type' => 'checkbox',
- 'label' => __('Open link new tab/window','rambo'),
- 'section' => 'site_intro',
- )
- );
- //Service
- $wp_customize->add_section( 'service_section_head' , array(
- 'title' => __('Service Setting ', 'rambo'),
- 'panel' => 'home_page_setting',
- ) );
- //Number of services
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[service_list]',
- array(
- 'default' => 4,
- 'type' => 'option',
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[service_list]',
- array(
- 'type' => 'select',
- 'label' => __('Enabled Number of services on Home Page(service section)','rambo'),
- 'section' => 'service_section_head',
- 'choices' => array(4=>4,8=>8,12=>12,16=>16,20=>20,24=>24),
- ));
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[service_section_title]',
- array(
- 'default' => __('Our Services','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option'
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[service_section_title]',
- array(
- 'label' => __('Service Title','rambo'),
- 'section' => 'service_section_head',
- 'type' => 'text',
- )
- );
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[service_section_descritpion]',
- array(
- 'default' => __('Check out our Main Services which we offer to every client','rambo'),
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option'
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[service_section_descritpion]',
- array(
- 'label' => __('Service Description','rambo'),
- 'section' => 'service_section_head',
- 'type' => 'textarea',
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- //Add Service setting
- class WP_service_Customize_Control extends WP_Customize_Control {
- public $type = 'new_menu';
- /**
- * Render the control's content.
- */
- public function render_content() {
- ?>
- <a href="<?php bloginfo ( 'url' );?>/wp-admin/edit.php?post_type=rambopro_service" class="button" target="_blank"><?php _e( 'Click Here To Add Service', 'rambo' ); ?></a>
- <?php
- }
- }
- $wp_customize->add_setting(
- 'service_front',
- array(
- 'default' => __('','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- $wp_customize->add_control( new WP_service_Customize_Control( $wp_customize, 'service_front', array(
- 'section' => 'service_section_head',
- 'priority' => 500,
- ))
- );
- //Portfolio setting
- $wp_customize->add_section(
- 'project_section_settings',
- array(
- 'title' => __('Project Setting','rambo'),
- 'description' => '',
- 'panel' => 'home_page_setting',)
- );
- // Number of Portfolio section
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[project_list]',
- array(
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control( 'rambo_pro_theme_options[project_list]',array(
- 'type' => 'select',
- 'label' => __('Number of Portfolio on Portfolio section','rambo'),
- 'section' => 'project_section_settings',
- 'choices' => array(4=>4,8=>8,12=>12,16=>16,20=>20,24=>24),
- )
- );
- //Project Title
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[project_protfolio_tag_line]',
- array(
- 'default' => __('Featured Portfolio Project','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control('rambo_pro_theme_options[project_protfolio_tag_line]',array(
- 'label' => __('Project title','rambo'),
- 'section' => 'project_section_settings',
- 'type' => 'text',) );
- //Project Description
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[project_protfolio_description_tag]',
- array(
- 'default' => __('Lorem ipsum dolor sit amet, consectetuer adipiscing elit lorem ipsum dolor sit amet','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control( 'rambo_pro_theme_options[project_protfolio_description_tag]',array(
- 'label' => __('Project Description','rambo'),
- 'section' => 'project_section_settings',
- 'type' => 'textarea',) );
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[taxonomy_portfolio_list]',
- array(
- 'default' => 2,
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control( 'rambo_pro_theme_options[taxonomy_portfolio_list]',array(
- 'type' => 'select',
- 'label' => __('Select Portfolio category archive column layout','rambo'),
- 'section' => 'project_section_settings',
- 'choices' => array(2=>2,3=>3,4=>4),
- )
- );
- //link
- class WP_project_Customize_Control extends WP_Customize_Control {
- public $type = 'new_menu';
- /**
- * Render the control's content.
- */
- public function render_content() {
- ?>
- <a href="<?php bloginfo ( 'url' );?>/wp-admin/edit.php?post_type=rambopro_project" class="button" target="_blank"><?php _e( 'Click Here To add Project', 'rambo' ); ?></a>
- <?php
- }
- }
- $wp_customize->add_setting(
- 'project',
- array(
- 'default' => __('','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- $wp_customize->add_control( new WP_project_Customize_Control( $wp_customize, 'project', array(
- 'section' => 'project_section_settings',
- ))
- );
- //Recent News setting
- $wp_customize->add_section(
- 'recent_news_settings',
- array(
- 'title' => __('Recent News Setting','rambo'),
- 'description' => '',
- 'panel' => 'home_page_setting',)
- );
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[home_latest_news_enabled]',
- array(
- 'default' => true,
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[home_latest_news_enabled]',
- array(
- 'label' => __('Enable Latest News Section','rambo'),
- 'section' => 'recent_news_settings',
- 'type' => 'checkbox',
- ));
- // //News Title
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[blog_section_head]',
- array(
- 'default' => __('Recent News','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control('rambo_pro_theme_options[blog_section_head]',array(
- 'label' => __('Recent News Section Heading','rambo'),
- 'section' => 'recent_news_settings',
- 'type' => 'text',) );
- //Select number of latest news on front page
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[post_display_count]',
- array(
- 'type' => 'option',
- 'default' => __('3','rambo'),
- 'sanitize_callback' => 'sanitize_text_field',
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[post_display_count]',
- array(
- 'type' => 'select',
- 'label' => __('Select Number of Post','rambo'),
- 'section' => 'recent_news_settings',
- 'choices' => array('1'=>__('1', 'rambo'), '2'=>__('2', 'rambo'), '3' => __('3','rambo'), '4' => __('4','rambo'),'5'=> __('5','rambo'), '6'=> __('6','rambo'),'7'=> __('7','rambo'), '8' =>__('8','rambo'), '9' =>__('9','rambo'), '10' =>__('10','rambo'), '11' =>__('11','rambo'), '12' =>__('12','rambo'), '13' =>__('13','rambo'), '14' =>__('14','rambo'), '15' =>__('15','rambo')),
- ));
- //Footer call-out setting
- $wp_customize->add_section(
- 'footer_callout_setting',
- array(
- 'title' => __('Footer Call Out Area Setting','rambo'),
- 'description' => '',
- 'panel' => 'home_page_setting',)
- );
- //Footer callout text
- //Site intro
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[site_info_enabled]',
- array(
- 'default' => true,
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control(
- 'rambo_pro_theme_options[site_info_enabled]',
- array(
- 'label' => __('Enable Site Intro','rambo'),
- 'section' => 'footer_callout_setting',
- 'type' => 'checkbox',
- ));
- $wp_customize ->add_setting (
- 'rambo_pro_theme_options[site_info_title]',
- array(
- 'default' => __('Rambo is a clean and fully responsive Template.','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control (
- 'rambo_pro_theme_options[site_info_title]',
- array (
- 'label' => __('Footer call out title','rambo'),
- 'section' => 'footer_callout_setting',
- 'type' => 'text',
- ) );
- $wp_customize ->add_setting (
- 'rambo_pro_theme_options[site_info_descritpion]',
- array(
- 'default' => __('At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos excepturi vehicula sem ut volutpat. Ut non libero magna fusce condimentum eleifend enim a feugiat.','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control (
- 'rambo_pro_theme_options[site_info_descritpion]',
- array (
- 'label' => __('Footer call out description','rambo'),
- 'section' => 'footer_callout_setting',
- 'type' => 'textarea',
- ) );
- $wp_customize ->add_setting (
- 'rambo_pro_theme_options[site_info_button_text]',
- array(
- 'default' => __('Purchase Now','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- )
- );
- $wp_customize->add_control (
- 'rambo_pro_theme_options[site_info_button_text]',
- array (
- 'label' => __('Footer call out button text ','rambo'),
- 'section' => 'footer_callout_setting',
- 'type' => 'text',
- ) );
- $wp_customize ->add_setting (
- 'rambo_pro_theme_options[site_info_button_link]',
- array(
- 'default' => __('#','rambo'),
- 'capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- ) );
- $wp_customize->add_control (
- 'rambo_pro_theme_options[site_info_button_link]',
- array (
- 'label' => __('Call Out Button Link','rambo'),
- 'section' => 'footer_callout_setting',
- 'type' => 'text',
- ) );
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[site_info_button_link_target]',
- array('capability' => 'edit_theme_options',
- 'sanitize_callback' => 'sanitize_text_field',
- 'type' => 'option',
- 'default' => true,
- ));
- $wp_customize->add_control(
- 'rambo_pro_theme_options[site_info_button_link_target]',
- array(
- 'type' => 'checkbox',
- 'label' => __('Open link new tab/window','rambo'),
- 'section' => 'footer_callout_setting',
- )
- );
- $wp_customize->add_section(
- 'footer_copyright_setting',
- array(
- 'title' => __('Footer Copyright Custmization ','rambo'),
- 'description' => '',
- 'panel' => 'home_page_setting',)
- );
- $wp_customize->add_setting(
- 'rambo_pro_theme_options[footer_copyright]',
- array(
- 'default' => __('Copyright @ 2014 - RAMBO. Designed by <a href="http://webriti.com" rel="nofollow" target="_blank">Webriti</a>','rambo'),
- 'type' =>'option'
- ));
- $wp_customize->add_control(
- 'rambo_pro_theme_options[footer_copyright]',
- array(
- 'label' => __('Footer Customization text','rambo'),
- 'section' => 'footer_copyright_setting',
- 'type' => 'textarea',
- ));
- }
- add_action( 'customize_register', 'rambo_home_page_customizer' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement