__( 'Header Navigation', 'bunny' ) ) ); } endif; add_action( 'after_setup_theme', 'bunny_setup' ); /* add 'home' button to menu 'hem' knapp i menyn*/ function bunny_menu( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'bunny_menu' ); function bunny_editor_styles() { add_editor_style(); } add_action( 'init', 'bunny_editor_styles' ); /* Enqueue fonts */ function bunny_fonts_styles() { wp_enqueue_style( 'bunny_style', get_stylesheet_uri() ); wp_enqueue_style( 'bunny_Font','//fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic&subset=latin,latin-ext'); wp_enqueue_style( 'bunny_Font2','//fonts.googleapis.com/css?family=Oswald&subset=latin,latin-ext'); wp_enqueue_script( 'bunny_webfont', get_template_directory_uri() . '/inc/webfont.js', array( 'jquery' ) ); wp_enqueue_script( 'bunny_sprite', get_template_directory_uri() . '/inc/spritely.js', array( 'jquery' ) ); wp_enqueue_script( 'bunny_arc', get_template_directory_uri() . '/inc/arctext.js', array( 'jquery' ) ); wp_enqueue_script( 'bunny_bunny', 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_action('wp_enqueue_scripts', 'bunny_fonts_styles'); /* 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 Sidebar', 'bunny' ), 'description' => __( 'Widgets in this area will be shown in the footer.', 'bunny' ), ) ); } add_action( 'widgets_init', 'bunny_widgets_init' ); /** * Filters wp_title to print a neat