__('Top Menu', 'amplifyworldwide'),
'footer-menu' => __('Footer Menu', 'amplifyworldwide'),
)
);
//====================================================================
// Load Translation
//====================================================================
load_theme_textdomain( 'amplifyworldwide', language_file_path );
//====================================================================
// Add wordpress theme requirements
//====================================================================
add_action( 'after_setup_theme', 'theme_slug_setup' );
function theme_slug_setup() {
add_theme_support( 'title-tag' );
}
add_theme_support( 'automatic-feed-links' );
if ( ! isset( $content_width ) ) {
$content_width = 900;
}
if ( is_singular() ) wp_enqueue_script( "comment-reply" );
function wpdocs_theme_add_editor_styles() {
add_editor_style( 'custom-editor-style.css' );
}
add_action( 'admin_init', 'wpdocs_theme_add_editor_styles' );
$args = array(
'default-color' => '000000',
'default-image' => '%1$s/images/background.jpg',
);
add_theme_support( 'custom-background', $args );
$args = array(
'default-color' => '000000',
'default-image' => '%1$s/images/background.jpg',
);
add_theme_support( 'custom-header', $args );
/**
* Add a sidebar.
*/
function wpdocs_theme_slug_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'amplifyworldwide' ),
'id' => 'dynamic_sidebar',
'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'amplifyworldwide' ),
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'wpdocs_theme_slug_widgets_init' );
//====================================================================
// Add Social Media Fields to Customizer
//====================================================================
function mytheme_customize_register( $wp_customize ) {
$wp_customize->add_section( 'mytheme_company_section' , array(
'title' => __( 'Social Media Accounts', 'amplifyworldwide' ),
'priority' => 30,
));
$wp_customize->add_setting( 'mytheme_company-instagramAccount', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_company_control1',
array(
'label' => __( 'Instagram Account', 'amplifyworldwide' ),
'section' => 'mytheme_company_section',
'settings' => 'mytheme_company-instagramAccount',
'priority' => 1
)
)
);
$wp_customize->add_setting( 'mytheme_company-facebookAccount', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_company_control2',
array(
'label' => __( 'Facebook Account', 'amplifyworldwide' ),
'section' => 'mytheme_company_section',
'settings' => 'mytheme_company-facebookAccount',
'priority' => 2
)
)
);
$wp_customize->add_setting( 'mytheme_company-twitterAccount', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_company_control3',
array(
'label' => __( 'Twitter Account', 'amplifyworldwide' ),
'section' => 'mytheme_company_section',
'settings' => 'mytheme_company-twitterAccount',
'priority' => 2
)
)
);
$wp_customize->add_setting( 'mytheme_company-linkedinAccount', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_company_control4',
array(
'label' => __( 'LinkedIn Account', 'amplifyworldwide' ),
'section' => 'mytheme_company_section',
'settings' => 'mytheme_company-linkedinAccount',
'priority' => 2
)
)
);
// ..repeat ->add_setting() and ->add_control() for mytheme_company-division
}
add_action( 'customize_register', 'mytheme_customize_register' );
//====================================================================
// Add New Color Option in Existing Colors Section in Customizer
//====================================================================
function diwp_customizer_add_colorPicker( $wp_customize){
// Add Settings
// Add Settings
$wp_customize->add_setting( 'pri_color', array(
'default' => '#04bfbf',
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_setting( 'sec_color', array(
'default' => '#45ace0',
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_setting( 'nav_color', array(
'default' => '#45ace0',
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
// Add Controls
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'pri_color', array(
'label' => __( 'Primary Color' ),
'section' => 'colors',
'settings' => 'pri_color'
)));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'sec_color', array(
'label' => __( 'Secondary Color' ),
'section' => 'colors',
'settings' => 'sec_color'
)));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_color', array(
'label' => __( 'Nav Bar Color' ),
'section' => 'colors',
'settings' => 'nav_color'
)));
}
add_action( 'customize_register', 'diwp_customizer_add_colorPicker' );
//====================================================================
// Add Email and Phone
//====================================================================
function mytheme_customize_register_contact( $wp_customize ) {
$wp_customize->add_section( 'mytheme_company_section_contact' , array(
'title' => __( 'Contact Info', 'amplifyworldwide' ),
'priority' => 30,
));
$wp_customize->add_setting( 'mytheme_company-phone', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_company_contact1',
array(
'label' => __( 'Phone Number', 'amplifyworldwide' ),
'section' => 'mytheme_company_section_contact',
'settings' => 'mytheme_company-phone',
'priority' => 1
)
)
);
$wp_customize->add_setting( 'diwp_logo_phone', array(
'default' => get_theme_file_uri('assets/image/logo.jpg'), // Add Default Image URL
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'diwp_logo_control_phone', array(
'label' => __( 'Upload Phone Number Image' ),
'priority' => 20,
'section' => 'mytheme_company_section_contact',
'settings' => 'diwp_logo_phone',
'button_labels' => array(// All These labels are optional
'select' => 'Select Image',
'remove' => 'Remove Image',
'change' => 'Change Image',
)
)));
$wp_customize->add_setting( 'mytheme_company-email', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_company_contact2',
array(
'label' => __( 'Email', 'amplifyworldwide' ),
'section' => 'mytheme_company_section_contact',
'settings' => 'mytheme_company-email',
'priority' => 1
)
)
);
$wp_customize->add_setting( 'diwp_logo_email', array(
'default' => get_theme_file_uri('assets/image/logo.jpg'), // Add Default Image URL
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'diwp_logo_control_email', array(
'label' => __( 'Upload Email Image' ),
'priority' => 20,
'section' => 'mytheme_company_section_contact',
'settings' => 'diwp_logo_email',
'button_labels' => array(// All These labels are optional
'select' => 'Select Image',
'remove' => 'Remove Image',
'change' => 'Change Image',
)
)));
$wp_customize->add_setting( 'mytheme_contact_text', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_company_contact_3',
array(
'type' => 'textarea',
'label' => __( 'Paragraph On Contact Page', 'amplifyworldwide' ),
'section' => 'mytheme_company_section_contact',
'settings' => 'mytheme_contact_text',
'priority' => 21
)
)
);
Kirki::add_config( 'theme_config_id_form_field', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
Kirki::add_field( 'theme_config_id_form_field', [
'type' => 'editor',
'priority' => 22,
'settings' => 'mytheme_contact_form',
'label' => esc_html__( 'Form on Home Page', 'amplifyworldwide' ),
'section' => 'mytheme_company_section_contact',
'default' => '',
] );
// ..repeat ->add_setting() and ->add_control() for mytheme_company-division
}
add_action( 'customize_register', 'mytheme_customize_register_contact' );
//====================================================================
// Add Services Fields to Customizer
//====================================================================
function mytheme_customize_register_content( $wp_customize ) {
$wp_customize->add_section( 'mytheme_content_section' , array(
'title' => __( 'Services Section', 'amplifyworldwide' ),
'priority' => 30,
));
// SERVICES SECTION
$wp_customize->add_setting( 'mytheme_service_image1', array(
'default' => get_theme_file_uri('assets/image/logo.jpg'), // Add Default Image URL
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'mytheme_service_image1', array(
'label' => __( 'Service Image 1' ),
'priority' => 1,
'section' => 'mytheme_content_section',
'settings' => 'mytheme_service_image1',
'button_labels' => array(// All These labels are optional
'select' => 'Select Image',
'remove' => 'Remove Image',
'change' => 'Change Image',
)
)));
$wp_customize->add_setting( 'mytheme_service_header1', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_content_section2',
array(
'label' => __( 'Service Header 1', 'amplifyworldwide' ),
'section' => 'mytheme_content_section',
'settings' => 'mytheme_service_header1',
'priority' => 2
)
)
);
$wp_customize->add_setting( 'mytheme_service_text1', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_content_section3',
array(
'type' => 'textarea',
'label' => __( 'Service Text 1', 'amplifyworldwide' ),
'section' => 'mytheme_content_section',
'settings' => 'mytheme_service_text1',
'priority' => 3
)
)
);
$wp_customize->add_setting( 'mytheme_service_image2', array(
'default' => get_theme_file_uri('assets/image/logo.jpg'), // Add Default Image URL
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'mytheme_service_image4', array(
'label' => __( 'Service Image 2' ),
'priority' => 4,
'section' => 'mytheme_content_section',
'settings' => 'mytheme_service_image2',
'button_labels' => array(// All These labels are optional
'select' => 'Select Image',
'remove' => 'Remove Image',
'change' => 'Change Image',
)
)));
$wp_customize->add_setting( 'mytheme_service_header2', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_content_section5',
array(
'label' => __( 'Service Header 2', 'amplifyworldwide' ),
'section' => 'mytheme_content_section',
'settings' => 'mytheme_service_header2',
'priority' => 5
)
)
);
$wp_customize->add_setting( 'mytheme_service_text2', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_content_section6',
array(
'type' => 'textarea',
'label' => __( 'Service Text 2', 'amplifyworldwide' ),
'section' => 'mytheme_content_section',
'settings' => 'mytheme_service_text2',
'priority' => 6
)
)
);
$wp_customize->add_setting( 'mytheme_service_image3', array(
'default' => get_theme_file_uri('assets/image/logo.jpg'), // Add Default Image URL
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'mytheme_service_image7', array(
'label' => __( 'Service Image 3' ),
'priority' => 7,
'section' => 'mytheme_content_section',
'settings' => 'mytheme_service_image3',
'button_labels' => array(// All These labels are optional
'select' => 'Select Image',
'remove' => 'Remove Image',
'change' => 'Change Image',
)
)));
$wp_customize->add_setting( 'mytheme_service_header3', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_content_section8',
array(
'label' => __( 'Service Header 3', 'amplifyworldwide' ),
'section' => 'mytheme_content_section',
'settings' => 'mytheme_service_header3',
'priority' => 8
)
)
);
$wp_customize->add_setting( 'mytheme_service_text3', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_content_section9',
array(
'type' => 'textarea',
'label' => __( 'Service Text 3', 'amplifyworldwide' ),
'section' => 'mytheme_content_section',
'settings' => 'mytheme_service_text3',
'priority' => 9
)
)
);
// ..repeat ->add_setting() and ->add_control() for mytheme_company-division
}
add_action( 'customize_register', 'mytheme_customize_register_content' );
//====================================================================
// Add Services Fields to Customizer
//====================================================================
function mytheme_customize_register_content1( $wp_customize ) {
$wp_customize->add_section( 'mytheme_content_about' , array(
'title' => __( 'About Section', 'amplifyworldwide' ),
'priority' => 31,
));
// SERVICES SECTION
$wp_customize->add_setting( 'mytheme_about_image1', array(
'default' => get_theme_file_uri('assets/image/logo.jpg'), // Add Default Image URL
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'mytheme_about_image1', array(
'label' => __( 'About Image 1' ),
'priority' => 1,
'section' => 'mytheme_content_about',
'settings' => 'mytheme_about_image1',
'button_labels' => array(// All These labels are optional
'select' => 'Select Image',
'remove' => 'Remove Image',
'change' => 'Change Image',
)
)));
$wp_customize->add_setting( 'mytheme_about_text1', array(
'sanitize_callback' => 'wp_filter_nohtml_kses'
));
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize,
'mytheme_content_about2',
array(
'type' => 'textarea',
'label' => __( 'About Text 1', 'amplifyworldwide' ),
'section' => 'mytheme_content_about',
'settings' => 'mytheme_about_text1',
'priority' => 2
)
)
);
}
add_action( 'customize_register', 'mytheme_customize_register_content1' );
//====================================================================
// Add Testimonial Fields to Customizer
//====================================================================
function mytheme_customize_register_content3( $wp_customize ) {
$wp_customize->add_section( 'mytheme_content_test' , array(
'title' => __( 'Testimonials Section', 'amplifyworldwide' ),
'priority' => 33,
));
Kirki::add_config( 'theme_config_id_client_test', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
Kirki::add_field( 'theme_config_id_client_test', [
'type' => 'repeater',
'label' => esc_html__( 'Client Testimonial Section', 'amplifyworldwide' ),
'section' => 'mytheme_content_test',
'priority' => 2,
'row_label' => [
'type' => 'text',
'value' => esc_html__( 'Client Testimonial', 'amplifyworldwide' ),
],
'button_label' => esc_html__('Add new', 'amplifyworldwide' ),
'settings' => 'my_repeater_setting_cli_test',
'default' => [
[
'text_cli_test_tag' => esc_html__( 'Client Testimonial', 'amplifyworldwide' ),
'name_cli_test_tag' => esc_html__( 'Client Name', 'amplifyworldwide' ),
'pos_cli_test_tag' => esc_html__( 'Client Job Title', 'amplifyworldwide' ),
],
],
'fields' => [
'text_cli_test_tag' => [
'type' => 'textarea',
'label' => esc_html__( 'Client Testimonial', 'amplifyworldwide' ),
'default' => '',
],
'name_cli_test_tag' => [
'type' => 'text',
'label' => esc_html__( 'Client Name', 'amplifyworldwide' ),
'default' => '',
],
'pos_cli_test_tag' => [
'type' => 'text',
'label' => esc_html__( 'Client Job Title', 'amplifyworldwide' ),
'default' => '',
],
]
] );
}
add_action( 'customize_register', 'mytheme_customize_register_content3' );
//====================================================================
// Add Why Choose Fields to Customizer
//====================================================================
function mytheme_customize_register_content7( $wp_customize ) {
$wp_customize->add_section( 'mytheme_content_why_choose_section' , array(
'title' => __( 'Why Choose Us Section', 'amplifyworldwide' ),
'priority' => 32,
));
Kirki::add_config( 'theme_config_id_why_choose', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
Kirki::add_field( 'theme_config_id_why_choose', [
'type' => 'repeater',
'label' => esc_html__( 'Why Choose Us Section', 'amplifyworldwide' ),
'section' => 'mytheme_content_why_choose_section',
'priority' => 2,
'row_label' => [
'type' => 'text',
'value' => esc_html__( 'Why Choose Us', 'amplifyworldwide' ),
],
'button_label' => esc_html__('Add new', 'amplifyworldwide' ),
'settings' => 'my_repeater_setting_why',
'default' => [
[
'header_why_us_tag' => esc_html__( 'Header Why', 'amplifyworldwide' ),
'text_why_us_tag' => esc_html__( 'Text Why', 'amplifyworldwide' ),
],
],
'fields' => [
'header_why_us_tag' => [
'type' => 'text',
'label' => esc_html__( 'Header Why', 'amplifyworldwide' ),
'default' => '',
],
'text_why_us_tag' => [
'type' => 'textarea',
'label' => esc_html__( 'Text Why', 'amplifyworldwide' ),
'default' => '',
],
]
] );
}
add_action( 'customize_register', 'mytheme_customize_register_content7' );
//====================================================================
// Add FAQs Fields to Customizer
//====================================================================
function mytheme_customize_register_content4( $wp_customize ) {
$wp_customize->add_section( 'mytheme_content_faq' , array(
'title' => __( 'FAQs Section', 'amplifyworldwide' ),
'priority' => 34,
));
Kirki::add_config( 'theme_config_id', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
Kirki::add_field( 'theme_config_id', [
'type' => 'repeater',
'label' => esc_html__( 'FAQs', 'amplifyworldwide' ),
'section' => 'mytheme_content_faq',
'priority' => 10,
'row_label' => [
'type' => 'text',
'value' => esc_html__( 'FAQ Question', 'amplifyworldwide' ),
],
'button_label' => esc_html__('Add new', 'amplifyworldwide' ),
'settings' => 'my_repeater_setting',
'default' => [
[
'header_faq_tag' => esc_html__( 'Kirki Site', 'amplifyworldwide' ),
'text_faq_tag' => 'https://kirki.org/',
],
],
'fields' => [
'header_faq_tag' => [
'type' => 'text',
'label' => esc_html__( 'Header FAQ', 'amplifyworldwide' ),
'default' => '',
],
'text_faq_tag' => [
'type' => 'textarea',
'label' => esc_html__( 'Text FAQ', 'amplifyworldwide' ),
'default' => '',
],
]
] );
}
add_action( 'customize_register', 'mytheme_customize_register_content4' );
//====================================================================
// ADD SERVICE LOCATIONS
//====================================================================
function mytheme_customize_register_content5( $wp_customize ) {
$wp_customize->add_section( 'mytheme_content_locations' , array(
'title' => __( 'Service Locations Section', 'amplifyworldwide' ),
'priority' => 35,
));
Kirki::add_config( 'theme_config_id_service_locations', array(
'capability' => 'edit_theme_options',
'option_type' => 'theme_mod',
) );
Kirki::add_field( 'theme_config_id_service_locations', [
'type' => 'repeater',
'label' => esc_html__( 'Service Locations Section', 'amplifyworldwide' ),
'section' => 'mytheme_content_locations',
'priority' => 2,
'row_label' => [
'type' => 'text',
'value' => esc_html__( 'Location', 'amplifyworldwide' ),
],
'button_label' => esc_html__('Add new', 'amplifyworldwide' ),
'settings' => 'my_repeater_setting_location',
'default' => [
[
'location_tag' => esc_html__( 'Location', 'amplifyworldwide' ),
],
],
'fields' => [
'location_tag' => [
'type' => 'text',
'label' => esc_html__( 'Location', 'amplifyworldwide' ),
'default' => '',
],
]
] );
}
add_action( 'customize_register', 'mytheme_customize_register_content5' );
//====================================================================
// Repeater Items Customizer
//====================================================================
include_once( dirname( __FILE__ ) . '/includes/kirki/kirki.php' );
function mytheme_kirki_configuration() {
return array( 'url_path' => get_stylesheet_directory_uri() . '/includes/kirki/' );
}
add_filter( 'kirki/config', 'mytheme_kirki_configuration' );
//====================================================================
// Remove Unused Menu Items Customizer
//====================================================================
function my_customize_register01() {
global $wp_customize;
$wp_customize->remove_panel( 'nav_menus' ); //Modify this line as needed
$wp_customize->remove_section( 'static_front_page' );
$wp_customize->remove_section( 'custom_css' );
}
add_action( 'customize_register', 'my_customize_register01', 11 );