__( 'Main Menu', 'brand-new-day' ), ) ); load_theme_textdomain( 'brand-new-day', get_template_directory() . '/languages' ); add_theme_support( 'print-style' ); function brand_new_day_print_styles() { $options = brand_new_day_get_theme_options(); $brand_new_day_themestyle = $options['theme_style']; wp_enqueue_style( 'brand_new_day', get_stylesheet_uri() ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); switch ( $brand_new_day_themestyle ) { case 'nightlight': wp_enqueue_style( 'brand_new_day_nightlight', get_template_directory_uri() . '/css/nightlight.css', array( 'brand_new_day' ), '20111212' ); break; case 'winterlight': wp_enqueue_style( 'brand_new_day_winterlight', get_template_directory_uri() . '/css/winterlight.css', array( 'brand_new_day' ), '20111212' ); break; case 'autumnlight': wp_enqueue_style( 'brand_new_day_autumnlight', get_template_directory_uri() . '/css/autumnlight.css', array( 'brand_new_day' ), '20111212' ); break; default: wp_enqueue_style( 'brand_new_day_daylight', get_template_directory_uri() . '/css/daylight.css', array( 'brand_new_day' ), '20111212' ); break; } } add_action( 'wp_enqueue_scripts', 'brand_new_day_print_styles' ); function brand_new_day_sidebars() { register_sidebar( array( 'id' => 'vertical-sidebar', 'name' => __( 'Vertical Sidebar', 'brand-new-day' ), 'before_widget' => '
  • ', 'after_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ) ); register_sidebar( array( 'id' => 'footer-sidebar1', 'name' => __( 'Footer Sidebar 1', 'brand-new-day' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'id' => 'footer-sidebar2', 'name' => __( 'Footer Sidebar 2', 'brand-new-day' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'id' => 'footer-sidebar3', 'name' => __( 'Footer Sidebar 3', 'brand-new-day' ), 'before_widget' => '', 'before_title' => '', ) ); register_sidebar( array( 'id' => 'footer-sidebar4', 'name' => __( 'Footer Sidebar 4', 'brand-new-day' ), 'before_widget' => '', 'before_title' => '', ) ); } add_action( 'widgets_init', 'brand_new_day_sidebars' ); if ( ! isset( $content_width ) ) $content_width = 630; add_theme_support( 'automatic-feed-links' ); add_editor_style(); /** * Filter in a link to a content ID attribute for the next/previous image links on image attachment pages */ function brand_new_day_enhanced_image_navigation( $url ) { global $post, $wp_rewrite; if ( empty( $post ) ) { return $url; } $id = (int) $post->ID; $object = get_post( $id ); if ( wp_attachment_is_image( $post->ID ) && ( $wp_rewrite->using_permalinks() && ( $object->post_parent > 0 ) && ( $object->post_parent != $id ) ) ) $url = $url . '#main'; return $url; } add_filter( 'attachment_link', 'brand_new_day_enhanced_image_navigation' ); /** * WP.com: Check the current color scheme and set the correct themecolors array */ $options = get_option( 'brand_new_day_theme_options' ); $theme_style = $options['theme_style'] ?? 'default'; switch ( $theme_style ) { case 'nightlight': $themecolors = array( 'bg' => '3a6a8c', 'border' => 'caedf1', 'text' => 'ffffff', 'link' => 'd7d8a7', 'url' => 'd7d8a7', ); break; case 'winterlight': $themecolors = array( 'bg' => 'f0f0f0', 'border' => 'caedf1', 'text' => '555555', 'link' => '666666', 'url' => '666666', ); break; case 'autumnlight': $themecolors = array( 'bg' => 'f4f8f8', 'border' => 'd6e6e8', 'text' => '333333', 'link' => 'a4461c', 'url' => 'a4461c', ); break; default: // daylight $themecolors = array( 'bg' => 'dcf5f8', 'border' => 'caedf1', 'text' => '555555', 'link' => '55bac6', 'url' => '55bac6', ); break; } /** * Filters wp_title to print a neat tag based on what is being viewed. * * @since Brand New Day 1.4 */ function brand_new_day_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'brand-new-day' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'brand_new_day_wp_title', 10, 2 );