'',
'amp_soc_twitter' => '',
'amp_you_tube' => '',
'amp_soc_gplus' => ''
);
return get_option( 'amp_theme_options', $amp_theme_options );
}
function amp_sanitize_checkbox( $input ) {
return absint( $input );
}
function amp_customize_register( $wp_customize ) {
$wp_customize->add_section( 'amp_options_section' , array(
'title' => __( 'Theme Options', 'amp' ),
'priority' => 30,
'description' => 'Add social links, background and logo',
) );
$wp_customize->add_section( 'amp_options_information' , array(
'title' => __( 'Theme Information', 'amp' ),
'priority' => 150,
'description' => __( 'Theme Author: Larry Judd Oliver
Phoenix, Arizona USA', 'amp' ),
) );
// facebook
$wp_customize->add_setting('amp_theme_options[amp_soc_facebook]', array(
'default' => '',
'type' => 'option',
'sanitize_callback' => 'esc_url_raw',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control('amp_theme_options[amp_soc_facebook]', array(
'label' => __('Facebook', 'amp'),
'section' => 'amp_options_section',
'settings' => 'amp_theme_options[amp_soc_facebook]',
) );
// twitter
$wp_customize->add_setting('amp_theme_options[amp_soc_twitter]', array(
'default' => '',
'type' => 'option',
'sanitize_callback' => 'esc_url_raw',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control('amp_theme_options[amp_soc_twitter]', array(
'label' => __('Twitter', 'amp'),
'section' => 'amp_options_section',
'settings' => 'amp_theme_options[amp_soc_twitter]',
) );
// share square
$wp_customize->add_setting('amp_theme_options[amp_you_tube]', array(
'default' => '',
'type' => 'option',
'sanitize_callback' => 'esc_url_raw',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control('amp_theme_options[amp_you_tube]', array(
'label' => __('YouTube', 'amp'),
'section' => 'amp_options_section',
'settings' => 'amp_theme_options[amp_you_tube]',
) );
// gplus
$wp_customize->add_setting('amp_theme_options[amp_soc_gplus]', array(
'default' => '',
'type' => 'option',
'sanitize_callback' => 'esc_url_raw',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control('amp_theme_options[amp_soc_gplus]', array(
'label' => __('Google Plus', 'amp'),
'section' => 'amp_options_section',
'settings' => 'amp_theme_options[amp_soc_gplus]',
) );
// footer background
$wp_customize->add_setting( 'amp_footer_back', array(
'sanitize_callback' => 'esc_url_raw',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control( new WP_Customize_Image_Control(
$wp_customize, 'amp_footer_back', array(
'label' => __( 'Footer Background', 'amp' ),
'description' => __( 'Upload image or use color control below', 'amp' ),
'section' => 'amp_options_section',
'settings' => 'amp_footer_back',
) ) );
// custom logo upload
$wp_customize->add_setting( 'amp_logo', array(
'sanitize_callback' => 'esc_url_raw',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control( new WP_Customize_Image_Control(
$wp_customize, 'amp_logo', array(
'label' => __( 'Logo', 'amp' ),
'description' => __( 'Logo sits to the right of post title', 'amp' ),
'section' => 'amp_options_section',
'settings' => 'amp_logo',
) ) );
// custom link colors
$wp_customize->add_setting( 'amp_link', array(
'sanitize_callback' => 'sanitize_hex_color',
'default' => '#0055aa',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize, 'amp_link', array(
'label' => __( 'Link colors', 'amp' ),
'section' => 'colors',
'settings' => 'amp_link',
) ) );
// content background color
$wp_customize->add_setting( 'amp_content_back', array(
'sanitize_callback' => 'sanitize_hex_color',
'default' => '#ffffff',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize, 'amp_content_back', array(
'label' => __( 'Content Background Color', 'amp' ),
'section' => 'colors',
'settings' => 'amp_content_back',
) ) );
// content text color
$wp_customize->add_setting( 'amp_text_color', array(
'sanitize_callback' => 'sanitize_hex_color',
'default' => '#7a7a7a',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control( new WP_Customize_Color_Control(
$wp_customize, 'amp_text_color', array(
'label' => __( 'Content Text Color', 'amp' ),
'section' => 'colors',
'settings' => 'amp_text_color',
) ) );
$wp_customize->add_setting( 'amp_options_information', array(
'sanitize_callback' => 'sanitize_text_field',
'priority' => 11,
'capability' => 'edit_theme_options',
'default' => '',
'settings' => 'amp_options_information',
) );
$wp_customize->add_control( new WP_Customize_Control(
$wp_customize, 'amp_options_information', array(
'label' => __( 'Theme by Tradesouthwest =|=', 'threeway' ),
'section' => 'amp_options_information',
'description' => sprintf( __( '
Tradesouthwest Themes Website
', 'amp' ), esc_url('http://themes.tradesouthwest.com') ), 'type' => 'hidden', 'settings' => 'amp_options_information', ) ) ); } add_action( 'customize_register', 'amp_customize_register' ); // now put the options to work in amp theme function amp_customize_css() { ?>