__( 'Widget Area 1', 'destination_free' ),
'id' => 'widget-area-1',
'description' => __( 'Add widgets here to appear in your sidebar.', 'destination_free' ),
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Widget Area 2', 'destination_free' ),
'id' => 'widget-area-2',
'description' => __( 'Add widgets here to appear in your sidebar.', 'destination_free' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'destination_free_widgets_init' );
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'destination_free-new-size', 1280, 9999, false );
}
add_filter('image_size_names_choose', 'destination_free_image_sizes');
function destination_free_image_sizes($sizes) {
$addsizes = array(
'destination_free-new-size' => 'Full Width'
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}
if ( ! function_exists( 'destination_free_comment' ) ) :
function destination_free_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
id="li-comment-">
remove_section( 'static_front_page' );
$wp_customize->remove_section( 'colors' );
$wp_customize->add_section(
'intro_section',
array(
'title' => __( 'Blog Introduction', 'destination_free'),
'description' => __('Blog introduction is the very first part of your site your readers will see. Use it wisely and do not forget to attach a background picture.', 'destination_free'),
'priority' => 33,
)
);
$wp_customize->add_setting(
'title_textbox',
array(
'default' => __('Type in your title text.', 'destination_free'),
'sanitize_callback' => 'esc_attr',
)
);
$wp_customize->add_control(
'title_textbox',
array(
'label' => __('Title', 'destination_free'),
'section' => 'intro_section',
'type' => 'text',
)
);
$wp_customize->add_setting(
'subtitle_textbox',
array(
'default' => __('Type in your subtitle text.', 'destination_free'),
'sanitize_callback' => 'esc_attr',
)
);
$wp_customize->add_control(
'subtitle_textbox',
array(
'label' => __('Subtitle', 'destination_free'),
'section' => 'intro_section',
'type' => 'text',
)
);
$wp_customize->add_setting(
'intro-upload',
array(
'default' => '/wp-content/themes/destination_free-free/img/background.jpg',
'sanitize_callback' => 'destination_free_sanitize_upload',)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'intro-upload',
array(
'label' => __('Background Picture', 'destination_free'),
'section' => 'intro_section',
'settings' => 'intro-upload'
)
)
);
$wp_customize->add_section(
'personal_section',
array(
'title' => __('Personal Info', 'destination_free'),
'description' => __('Tell your readers who you are! Your picture will show in the upper left corner and will be the fastest way to your About Me page.', 'destination_free'),
'priority' => 33,
)
);
$wp_customize->add_setting(
'show_face',
array(
'default' => '',
'sanitize_callback' => 'destination_free_sanitize_checkbox',
)
);
$wp_customize->add_control(
'show_face',
array(
'type' => 'checkbox',
'label' => __('Show a picture of me.', 'destination_free'),
'section' => 'personal_section',
)
);
$wp_customize->add_setting(
'face-upload',
array(
'default' => '',
'sanitize_callback' => 'destination_free_sanitize_upload',)
);
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'face-upload',
array(
'label' => __('Picture Upload', 'destination_free'),
'section' => 'personal_section',
'settings' => 'face-upload'
)
)
);
$wp_customize->add_setting(
'face-link' , array(
'default' => '',
'sanitize_callback' => 'destination_free_sanitize_dropdown',
)
);
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'face-link', array(
'label' => __( 'Page Link', 'theme-name' ),
'section' => 'personal_section',
'type' => 'dropdown-pages',
'settings' => 'face-link',
) ) );
$wp_customize->add_section(
'index_section',
array(
'title' => __('Post Settings', 'destination_free' ),
'priority' => 33,
)
);
$wp_customize->add_setting(
'post_list',
array(
'sanitize_callback' => 'destination_free_sanitize_postorder',
)
);
$wp_customize->add_control(
'post_list',
array(
'type' => 'radio',
'label' => __('Post Order', 'destination_free' ),
'section' => 'index_section',
'description' => __('Set the post order. Would you rather begin telling your story from the beginning or do you prefer to begin from the end?', 'destination_free' ),
'choices' => array(
'left' => __( 'Starting Day 1', 'destination_free' ),
'right' => __( 'Latest Post First', 'destination_free'),
),
)
);
$wp_customize->add_section(
'copyright_section',
array(
'title' => __( 'Copyright' , 'destination_free' ),
'description' => __( 'Use this area for your copyright text.' , 'destination_free' ),
'priority' => 35,
)
);
$wp_customize->add_setting(
'copyright_textbox',
array(
'default' => __( 'Type in your copyright text.', 'destination_free' ),
'sanitize_callback' => 'esc_html',
)
);
$wp_customize->add_control(
'copyright_textbox',
array(
'label' => __( 'Copyright text' , 'destination_free' ),
'section' => 'copyright_section',
'type' => 'text',
)
);
$wp_customize->add_setting(
'show_date',
array(
'default' => '',
'sanitize_callback' => 'destination_free_sanitize_checkbox',
)
);
$wp_customize->add_control(
'show_date',
array(
'type' => 'checkbox',
'label' => __('Display Post Date', 'destination_free' ),
'section' => 'index_section',
)
);
}
function destination_free_sanitize_dropdown( $input ) {
if ( is_numeric( $input ) ) {
return intval( $input );
}
}
function destination_free_sanitize_postorder( $input ) {
$valid = array(
'left' => 'Starting Day 1',
'right' => 'Latest Post First',
);
if ( array_key_exists( $input, $valid ) ) {
return $input;
} else {
return '';
}
}
function destination_free_sanitize_checkbox( $input ) {
if ( 1 == $input ) {
return true;
} else {
return false;
}
}
function destination_free_sanitize_link( $input ) {
return wp_kses_post( force_balance_tags( $input ) );
}
function destination_free_sanitize_copyright( $input ) {
return wp_kses_post( force_balance_tags( $input ) );
}
function destination_free_sanitize_upload( $file ) {
if ( preg_match( '/\.(png|jpg|jpeg)$/', $file ) ) {
return $file;
} else {
return '';
}
}