'', 'width' => 0, 'height' => 0, 'flex-height' => false, 'flex-width' => false, 'uploads' => false, 'random-default' => false, 'header-text' => true, 'default-text-color' => '000000', 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support( 'custom-header', $bunny_ch ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'html5', array( 'gallery', 'caption' ) ); /* translate */ load_theme_textdomain( 'bunny', get_template_directory() . '/languages' ); /* add menu */ register_nav_menus( array('header' => __( 'Header Navigation', 'bunny' ) ) ); add_editor_style(); } endif; add_action( 'after_setup_theme', 'bunny_setup' ); function bunny_fonts_url() { $fonts_url = ''; /* Translators: If there are characters in your language that are not * supported by Oswald, translate this to 'off'. Do not translate * into your own language. */ $oswald = _x( 'on', 'Oswald font: on or off', 'bunny' ); /* Translators: If there are characters in your language that are not * supported by Open Sans, translate this to 'off'. Do not translate * into your own language. */ $open_sans = _x( 'on', 'Open Sans font: on or off', 'bunny' ); if ( 'off' !== $oswald || 'off' !== $open_sans ) { $font_families = array(); if ( 'off' !== $oswald ) { $font_families[] = 'Oswald:400,700,300'; } if ( 'off' !== $open_sans ) { $font_families[] = 'Open+Sans:400italic,400,700'; } //&subset=latin,greek-ext,vietnamese,greek,latin-ext,cyrillic $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' ); } return $fonts_url; } /* Enqueue fonts, styles and js*/ function bunny_fonts_styles() { wp_enqueue_style( 'bunny_style', get_stylesheet_uri() ); wp_enqueue_style( 'bunny-fonts', bunny_fonts_url(), array(), null ); /* Only enqueue the scripts for the animation and arc if they are needed. */ if ( get_theme_mod( 'bunny_animation' ) == '') { wp_enqueue_script( 'bunny_sprite', get_template_directory_uri() . '/inc/spritely.js', array( 'jquery' ) ); } if ( get_theme_mod( 'bunny_disable_arc' ) == '') { wp_enqueue_script( 'bunny_circletype', get_template_directory_uri() . '/inc/circletype.js', array( 'jquery' ) ); } wp_enqueue_script( 'bunny_js', get_template_directory_uri() . '/inc/bunny.js', array( 'jquery' ) ); /* Enqueue comment reply / threaded comments. */ if ( ! is_admin() ){ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } /* Add Easter eggs */ if ( get_theme_mod( 'bunny_easter_eggs' )) { wp_register_style('bunny_eggs', get_template_directory_uri() . '/eggs.css'); wp_enqueue_style('bunny_eggs'); /* Add that Christmas feeling */ }elseif ( get_theme_mod( 'bunny_christmas' )) { wp_register_style('bunny_christmas', get_template_directory_uri() . '/christmas.css'); wp_enqueue_style('bunny_christmas'); } } add_action('wp_enqueue_scripts', 'bunny_fonts_styles'); function bunny_css() { echo ''; } add_action( 'wp_head', 'bunny_css'); /* Add title to read more links */ add_filter( 'get_the_excerpt', 'bunny_custom_excerpt_more',100 ); add_filter( 'excerpt_more', 'bunny_excerpt_more',100 ); add_filter( 'the_content_more_link', 'bunny_content_more', 100 ); function bunny_continue_reading($id ) { return '' . __( 'Read more: ', 'bunny' ) . get_the_title($id) . ''; } function bunny_content_more($more) { global $id; return bunny_continue_reading( $id ); } function bunny_excerpt_more($more) { global $id; return '... '.bunny_continue_reading( $id ); } function bunny_custom_excerpt_more($output) { if (has_excerpt() && !is_attachment()) { global $id; $output .= ' '.bunny_continue_reading( $id ); } return $output; } /* Add a title to posts that are missing title */ add_filter( 'the_title', 'bunny_post_title' ); function bunny_post_title( $title ) { if ( $title == '' ) { return __( 'Untitled', 'bunny' ); }else{ return $title; } } /* Register widget areas (Sidebars) Skapa sidebars*/ function bunny_widgets_init() { register_sidebar( array( 'name' => __( 'Footer Widget area', 'bunny' ), 'id' => 'footer_widget', 'description' => __( 'Widgets in this area will be shown in the footer.', 'bunny' ), ) ); register_sidebar( array( 'name' => __( 'Sidebar', 'bunny' ), 'id' => 'sidebar_widget', 'description' => __( 'Widgets in this area will be shown in the right hand sidebar.', 'bunny' ), ) ); } add_action( 'widgets_init', 'bunny_widgets_init' ); /** * Filters wp_title to print a neat