__('Primary Menu', 'bubbly'),
'footer' => __('Footer Menu', 'bubbly')
));
add_theme_support('post-thumbnails');
add_image_size('featured', 1170, 400, true);
add_theme_support('automatic-feed-links');
// editor style
function bubbly_editor_style() {
add_editor_style( get_template_directory_uri() . '/css/editor-style.css' );
}
add_action('after_setup_theme', 'bubbly_editor_style');
// set content width
if (!isset($content_width)) {$content_width = 750;}
}
endif;
add_action('after_setup_theme', 'bubbly_setup');
// load css
function bubbly_css() {
wp_enqueue_style('bubbly_oswald', '//fonts.googleapis.com/css?family=Oswald:400');
wp_enqueue_style('bubbly_domine', '//fonts.googleapis.com/css?family=Domine:400,700');
wp_enqueue_style('bubbly_bootstrap_css', get_template_directory_uri() . '/css/bootstrap.min.css');
wp_enqueue_style('bubbly_style', get_stylesheet_uri());
}
add_action('wp_enqueue_scripts', 'bubbly_css');
// load javascript
function bubbly_javascript() {
wp_enqueue_script('bubbly_bootstrap_js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.1.1', true);
wp_enqueue_script('bubbly_script', get_template_directory_uri() . '/js/bubbly.js', array('jquery'), '1.0', true);
if (is_singular() && comments_open()) {wp_enqueue_script('comment-reply');}
}
add_action('wp_enqueue_scripts', 'bubbly_javascript');
// html5 shiv
function bubbly_html5_shiv() {
echo '';
}
add_action('wp_head', 'bubbly_html5_shiv');
// widgets
function bubbly_widgets_init() {
register_sidebar(array(
'name' => __('Footer - Left', 'bubbly'),
'id' => 'footer-sidebar-left',
'description' => __('Widgets in this area will appear in the left column of the footer.', 'bubbly'),
'before_widget' => '",
'before_title' => '
',
'after_title' => '
'
));
register_sidebar(array(
'name' => __('Footer - Middle', 'bubbly'),
'id' => 'footer-sidebar-middle',
'description' => __('Widgets in this area will appear in the middle column of the footer.', 'bubbly'),
'before_widget' => '",
'before_title' => '',
'after_title' => '
'
));
register_sidebar(array(
'name' => __('Footer - Right', 'bubbly'),
'id' => 'footer-sidebar-right',
'description' => __('Widgets in this area will appear in the right column of the footer.', 'bubbly'),
'before_widget' => '",
'before_title' => '',
'after_title' => '
'
));
}
add_action('widgets_init', 'bubbly_widgets_init');
// page titles
function bubbly_title($title, $sep) {
global $paged, $page;
if (is_feed()) { return $title; }
$title .= get_bloginfo('name');
$site_description = get_bloginfo('description', 'display');
if ($site_description && (is_home() || is_front_page())) { $title = "$title $sep $site_description"; }
if ($paged >= 2 || $page >= 2) { $title = "$title $sep " . sprintf( __('Page %s', 'bubbly'), max($paged, $page)); }
return $title;
}
add_filter('wp_title', 'bubbly_title', 10, 2);
// custom excerpt
if (!function_exists('bubbly_custom_excerpt')):
function bubbly_custom_excerpt($new_excerpt) {
global $post;
$raw_excerpt = $new_excerpt;
if ('' == $new_excerpt) {
$new_excerpt = get_the_content('');
$new_excerpt = strip_shortcodes($new_excerpt);
$new_excerpt = apply_filters('the_content', $new_excerpt);
$new_excerpt = substr($new_excerpt, 0, strpos( $new_excerpt, '' ) + 4);
$new_excerpt = str_replace(']]>', ']]>', $new_excerpt);
$excerpt_end = '' . '∼ ' . sprintf(__('Continue Reading', 'bubbly'), get_the_title()) . ' ∼
';
$excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end);
$new_excerpt .= $excerpt_end;
return $new_excerpt;
}
return apply_filters('bubbly_custom_excerpt', $new_excerpt, $raw_excerpt);
}
endif;
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'bubbly_custom_excerpt');
// pagination
if (!function_exists('bubbly_pagination')):
function bubbly_pagination() {
global $wp_query;
$big = 999999999;
echo '';
}
endif;
// comments
if (!function_exists('bubbly_comment')) :
function bubbly_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
id="li-comment-">
add_section('bubbly_logo_section', array(
'title' => __('Upload Logo', 'bubbly'),
'priority' => 1,
'type' => 'option'
));
$wp_customize->add_setting('bubbly_logo_setting', array(
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logo', array(
'label' => __('Logo', 'bubbly'),
'section' => 'bubbly_logo_section',
'settings' => 'bubbly_logo_setting'
)));
// link color
$wp_customize->add_setting('bubbly_link_color', array(
'default' => '#20b2aa',
'sanitize_callback' => 'sanitize_hex_color'
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'links', array(
'label' => __('Links', 'bubbly'),
'section' => 'colors',
'settings' => 'bubbly_link_color'
)));
// display options
$wp_customize->add_section('bubbly_display_section', array(
'title' => __('Display Options', 'bubbly'),
'priority' => 2,
'type' => 'option'
));
// show tagline
$wp_customize->add_setting('bubbly_tagline_setting', array(
'default' => 'yes',
'sanitize_callback' => 'bubbly_sanitize_yn'
));
$wp_customize->add_control('bubbly_tagline_setting', array(
'label' => __('Show tagline', 'bubbly'),
'section' => 'bubbly_display_section',
'settings' => 'bubbly_tagline_setting',
'type' => 'radio',
'choices' => array(
'yes' => 'Yes',
'no' => 'No'
)
));
// show features images in teasers
$wp_customize->add_setting('bubbly_feat_img_setting', array(
'default' => 'no',
'sanitize_callback' => 'bubbly_sanitize_yn'
));
$wp_customize->add_control('bubbly_feat_img_setting', array(
'label' => __('Show featured images on teasers', 'bubbly'),
'section' => 'bubbly_display_section',
'settings' => 'bubbly_feat_img_setting',
'type' => 'radio',
'choices' => array(
'yes' => 'Yes',
'no' => 'No'
)
));
function bubbly_sanitize_yn($value) {
if (!in_array($value, array('yes', 'no'))) :
$value = 'yes';
endif;
return $value;
}
}
add_action('customize_register', 'bubbly_customize_register');
// customizer CSS
function bubbly_customize_css() {
?>
-