__( 'Primary Menu', 'p2-breathe' ), ) ); /** * Enable support for Post Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); } endif; // breathe_setup add_action( 'after_setup_theme', 'breathe_setup' ); /** * Setup the WordPress core custom background feature. * * Hooks into the after_setup_theme action. */ function breathe_register_custom_background() { $args = array( 'default-color' => 'f1f1f1', 'default-image' => '', ); add_theme_support( 'custom-background', apply_filters( 'breathe_custom_background_args', $args ) ); } add_action( 'after_setup_theme', 'breathe_register_custom_background' ); /** * Register widgetized area and update sidebar with default widgets */ function breathe_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar for Posts', 'p2-breathe' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Sidebar for Pages', 'p2-breathe' ), 'id' => 'sidebar-pages', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'breathe_widgets_init' ); /** * Enqueue Google Fonts */ function breathe_fonts() { /** * 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. */ if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'p2-breathe' ) ) { wp_register_style( 'breathe-open-sans', "https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600" ); } if ( 'off' !== _x( 'on', 'Serif: on or off', 'p2-breathe' ) ) { wp_register_style( 'breathe-serif', "https://fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic,700italic" ); } } add_action( 'init', 'breathe_fonts' ); /** * Enqueue font styles in custom header admin */ function breathe_admin_fonts( $hook_suffix ) { if ( 'appearance_page_custom-header' != $hook_suffix ) return; wp_enqueue_style( 'breathe-open-sans' ); wp_enqueue_style( 'breathe-serif' ); } add_action( 'admin_enqueue_scripts', 'breathe_admin_fonts' ); /** * Enqueue scripts and styles */ function breathe_scripts() { wp_enqueue_style( 'breathe-style', get_stylesheet_uri() ); //wp_enqueue_style( 'breathe-open-sans' ); wp_enqueue_style( 'breathe-serif' ); wp_enqueue_script( 'breathe-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); wp_enqueue_script( 'breathe-mobile-helper', get_template_directory_uri() . '/js/mobile-helper.js', array(), '20130513', true ); wp_enqueue_script( 'breathe-js', get_template_directory_uri() . '/js/breathe.js', array( 'breathe-mobile-helper', 'o2-enquire' ), '20130513', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'breathe-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); } } add_action( 'wp_enqueue_scripts', 'breathe_scripts' ); /** * Add a no-sidebar body class, if there are no widgets in the sidebar. */ function breathe_check_no_sidebar( $body_classes ) { if( ! is_active_sidebar( 'sidebar-1' ) && ! ( is_page() && is_active_sidebar( 'sidebar-pages' ) ) ) $body_classes[] = 'no-sidebar'; return $body_classes; } add_filter( 'body_class', 'breathe_check_no_sidebar' ); /** * Implement the Custom Header feature */ require( get_template_directory() . '/inc/custom-header.php' );