'__return_false'));
add_theme_support('custom-background',array('default-color'=>'#CCC'));
add_theme_support('automatic-feed-links');
add_editor_style( array( 'css/editor-style.css', 'fonts/genericons.css', beverly_fonts_url() ) );
register_nav_menu('left-menu',__('Left Sidebar Menu'));
add_option('beverly_def_val', array('show_title'=>true, 'show_excerpt'=>true, 'show_author'=>true, 'show_tags'=>true, 'show_category'=>true, 'show_media'=>true, 'show_comments'=>true, 'show_pubdate'=>true));
}
function beverly_admin_pages() {
add_theme_page( __('Default values', 'Beverly') , __('Default values', 'Beverly'), 'manage_options', 'beverly_def_val', 'beverly_def_val_page_callback');
add_theme_page(__('Theme settings','Beverly'), __('Theme settings','Beverly'), 'manage_options', 'beverly_settings', 'beverly_settings_page_callback');
}
function beverly_register_fields() {
register_setting('beverly_def_val', 'beverly_def_val', 'beverly_sanitize_array' );
add_settings_section('beverly_def_val', __('Default values of new post', 'Beverly'), 'beverly_def_val_info_callback', 'beverly_def_val');
add_settings_field('beverly_def_val_checkboxes', __('Show','Beverly'), 'beverly_def_val_checkboxes_callback', 'beverly_def_val', 'beverly_def_val');
register_setting('beverly_main_settings', 'beverly_main_settings', 'beverly_sanitize_codes');
add_settings_section('beverly_main_settings', __('Main Settings', 'Beverly'), '', 'beverly_settings');
add_settings_field('favicon_url_input', __('Favicon url', 'Beverly'), 'beverly_favicon_callback', 'beverly_settings', 'beverly_main_settings');
add_settings_field('own_styles', __('Own CSS Styles', 'Beverly'), 'beverly_own_styles_callback', 'beverly_settings', 'beverly_main_settings');
add_settings_field('own_script', sprintf('%s
%s', __('Own JS Script', 'Beverly'),__('jQuery enabled', 'Beverly')), 'beverly_own_script_callback', 'beverly_settings', 'beverly_main_settings');
register_setting('beverly_graphic_settings', 'beverly_graphic_settings', 'beverly_sanitize_array' );
add_settings_section('beverly_graphic_settings', __('Graphic Settings', 'Beverly'), '', 'beverly_settings');
}
function beverly_favicon() {
$favicon_url = get_option('beverly_main_settings')['favicon_url'];
if(!empty($favicon_url)) { ?>
false, 'show_excerpt'=>false, 'show_author'=>false, 'show_tags'=>false, 'show_category'=>false, 'show_media'=>false, 'show_comments'=>false, 'show_pubdate'=>false);
} else {
$card_info = get_option('beverly_def_val');
}
if(sanitize_text_field($_POST['title'])) $card_info['show_title'] = true;
if(sanitize_text_field($_POST['post_excerpt_x'])) $card_info['show_excerpt'] = true;
if(sanitize_text_field($_POST['author'])) $card_info['show_author'] = true;
if(sanitize_text_field($_POST['tags'])) $card_info['show_tags'] = true;
if(sanitize_text_field($_POST['pubdate'])) $card_info['show_pubdate'] = true;
if(sanitize_text_field($_POST['media'])) $card_info['show_media'] = true;
if(sanitize_text_field($_POST['category'])) $card_info['show_category'] = true;
if(sanitize_text_field($_POST['comments'])) $card_info['show_comments'] = true;
update_post_meta( $post_id, 'card_info', $card_info );
}
function beverly_customize_register($wp_customize) {
$colors = array();
$colors[] = array( 'slug'=>'anchor_color', 'default' => '#2183c4', 'label' => __( 'Anchor color', 'Beverly' ) );
$colors[] = array( 'slug'=>'menu_anchor_color', 'default' => '#2183c4', 'label' => __( 'Anchor color in menu', 'Beverly' ) );
foreach($colors as $color) {
$wp_customize->add_setting( $color['slug'], array( 'default' => $color['default'], 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'refresh'));
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $color['slug'], array( 'label' => $color['label'], 'section' => 'colors', 'settings' => $color['slug'] )));
}
}
function beverly_customize_css() {
$sticky_count = beverly_get_sticky_count();
$sticky_count = ($sticky_count > 6 ? 6 : $sticky_count);
$column_count = ($sticky_count > 1 ? 2 : 1);
$anchor_color = get_option('anchor_color','#2183c4');
$menu_anchor_color = get_option('menu_anchor_color','#2183c4');
?>
';
$post = get_post();
$og_title = wp_title('-', false);
$og_site_name = get_bloginfo('name');
$og_url = beverly_get_cur_url();
$og_type = "website";
$og_description = get_bloginfo('description');
if( is_singular() ) {
$og_imgs = beverly_get_first_n_imgs(3, true);
if(has_post_thumbnail()) $og_imgs[0] = wp_get_attachment_image_src(get_post_thumbnail_id(), 'thumbnail')[0];
$og_type = "article";
$og_description = wp_trim_words(get_the_content());
?>
__( 'Left Sidebar Area', 'Beverly' ),
'id' => 'left-sidebar-area',
'description' => __( 'Appears in the left sidebar.', 'Beverly' ),
'class' => '',
'before_widget' => '',
'before_title' => '