__( 'Primary Menu', 'big-brother' ), 'social' => __( 'Social Links', 'big-brother' ), ) ); /** * Enable support for Post Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); /** * Setup the WordPress core custom background feature. */ add_theme_support( 'custom-background', apply_filters( 'big_brother_custom_background_args', array( 'default-color' => 'f5f6f7', 'default-position-x' => 'middle', 'default-repeat' => 'no-repeat', ) ) ); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); } endif; // big_brother_setup add_action( 'after_setup_theme', 'big_brother_setup' ); /** * Register widgetized area and update sidebar with default widgets */ function big_brother_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar', 'big-brother' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'big_brother_widgets_init' ); /** * Enqueue scripts and styles */ function big_brother_scripts() { wp_enqueue_style( 'big-brother-style', get_stylesheet_uri() ); wp_enqueue_style( 'big-brother-gentium' ); wp_enqueue_style( 'big-brother-open-sans' ); wp_enqueue_script( 'big-brother-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true ); wp_enqueue_script( 'big-brother-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } wp_enqueue_style( 'genericons', get_template_directory_uri() . '/genericons/genericons.css', array(), '3.3' ); if ( is_singular() && wp_attachment_is_image() ) { wp_enqueue_script( 'big-brother-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20120202' ); } } add_action( 'wp_enqueue_scripts', 'big_brother_scripts' ); /** * Implement the Custom Header feature. */ require get_template_directory() . '/inc/custom-header.php'; /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Custom functions that act independently of the theme templates. */ require get_template_directory() . '/inc/extras.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Load Jetpack compatibility file. */ require get_template_directory() . '/inc/jetpack.php'; /* * Breadcrumbs */ function big_brother_the_breadcrumbs() { if ( ! is_home() && ! is_front_page() ) { $before = ''; $after = ''; echo '' . __( 'Home', 'big-brother' ) . ''; if ( is_category() ) { global $wp_query; $cat = get_category( $wp_query->get_queried_object()->term_id ); $cat_direct_parent = get_category( $cat->parent ); if ( ! is_wp_error( $cat_direct_parent ) ) { $cat_parents = get_category_parents( $cat_direct_parent, true, '' ); if ( ! is_wp_error( $cat_parents ) ) echo '' . $cat_parents . ''; } echo $before . single_cat_title( '', false ) . $after; } elseif ( is_day() ) { echo '' . get_the_time( 'Y' ) . ''; echo '' . get_the_time( 'F' ) . ''; echo $before . get_the_time( 'd' ) . $after; } elseif ( is_month() ) { echo '' . get_the_time( 'Y' ) . ''; echo $before . get_the_time( 'F' ) . $after; } elseif ( is_year() ) { echo $before . get_the_time( 'Y' ) . $after; } elseif ( is_single() ) { global $post; if ( is_attachment() && $post->post_parent ) { echo '' . get_the_title( $post->post_parent ) . '' . $before . get_the_title() . $after; } else { echo $before . get_the_title() . $after; } } elseif ( is_page() ) { global $post; if ( $post->post_parent ) { $parent_id = $post->post_parent; $parent_links = array(); while ( $parent_id ) { $page = get_post( $parent_id ); $parent_links[] = '' . get_the_title( $page->ID ) . ''; $parent_id = $page->post_parent; } echo implode( array_reverse( $parent_links ) ); } echo $before . get_the_title() . $after; } elseif ( is_search() ) { echo $before . sprintf( __( 'Search results for '%s'', 'big-brother' ), get_search_query() ) . $after; } elseif ( is_tag() ) { echo $before . sprintf( __( 'Posts tagged '%s'', 'big-brother' ), single_tag_title( '', false ) ) . $after; } elseif ( is_author() ) { global $author; echo $before . sprintf( __( 'Articles posted by %s', 'big-brother' ), get_userdata( $author )->display_name ) . $after; } elseif ( is_404() ) { echo $before . __( 'Error 404', 'big-brother' ) . $after; } elseif ( is_tax( 'post_format', 'post-format-aside' ) ) { echo $before . __( 'Asides', 'big-brother' ) . $after; } elseif ( is_tax( 'post_format', 'post-format-image' ) ) { echo $before . __( 'Images', 'big-brother') . $after; } elseif ( is_tax( 'post_format', 'post-format-video' ) ) { echo $before . __( 'Videos', 'big-brother' ) . $after; } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) { echo $before . __( 'Quotes', 'big-brother' ) . $after; } elseif ( is_tax( 'post_format', 'post-format-link' ) ) { echo $before . __( 'Links', 'big-brother' ) . $after; } if ( get_query_var( 'paged' ) ) { echo $before . '(' . sprintf( __( 'Page %s', 'big-brother' ), get_query_var( 'paged' ) ) . ')' . $after; } } } /** * Register Google Fonts */ function big_brother_google_fonts() { /* translators: If there are characters in your language that are not supported by Gentium, translate this to 'off'. Do not translate into your own language. */ if ( 'off' !== _x( 'on', 'Gentium font: on or off', 'big-brother' ) ) { wp_register_style( 'big-brother-gentium', "https://fonts.googleapis.com/css?family=Gentium+Basic:400,700,400italic,700italic&subset=latin,latin-ext" ); } if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'big-brother' ) ) { wp_register_style( 'big-brother-open-sans', "https://fonts.googleapis.com/css?family=Open+Sans:400,800&subset=latin,latin-ext" ); } } add_action( 'init', 'big_brother_google_fonts' ); /** * Enqueue Google Fonts for custom headers */ function big_brother_admin_scripts( $hook_suffix ) { if ( 'appearance_page_custom-header' != $hook_suffix ) return; wp_enqueue_style( 'big-brother-gentium' ); wp_enqueue_style( 'big-brother-open-sans' ); } add_action( 'admin_enqueue_scripts', 'big_brother_admin_scripts' );