esc_html__( 'Main Menu', 'biru' ), ) ); } endif; add_action( 'after_setup_theme', 'biru_setup' ); /*-----------------------------------------------------------------------------------*/ /* Set the content width based on the theme's design and stylesheet. /* ----------------------------------------------------------------------------------*/ function biru_content_width() { $GLOBALS['content_width'] = apply_filters( 'biru_content_width', 640 ); } add_action( 'after_setup_theme', 'biru_content_width', 0 ); /*-----------------------------------------------------------------------------------*/ /* Register widgetized area and update sidebars with default widgets. /* ----------------------------------------------------------------------------------*/ function biru_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar', 'biru' ), 'id' => 'sidebar-1', 'description' => esc_html__( 'Right sidebar widgets here.', 'biru' ), 'before_widget' => '', 'before_title' => '
' . __( 'To view this protected post, enter the password below:', 'biru' ) . '
' . ''; return $form; } if ( !is_admin() ) { add_filter( 'the_password_form', 'biru_password_form' ); } /*-----------------------------------------------------------------------------------*/ /* Theme Options/Customizer. /* ----------------------------------------------------------------------------------*/ /* Get theme options. ---------------------------------------------------------------*/ function biru_get_option( $option_name, $default = '' ) { $options = get_option( 'biru_option' ); if( isset($options[$option_name]) ) { return $options[$option_name]; } return $default; } /* Display logo. --------------------------------------------------------------------*/ function biru_site_branding() { $header_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; $branding_logo = esc_url( biru_get_option( 'logo' ) ); $branding_display = ( biru_get_option( 'display', 'site_title' ) == 'site_title' ) ? 'display-title' : 'display-logo'; $branding_tagline = get_bloginfo( 'description' ); echo ''; } /* Display header social media icons. -----------------------------------------------*/ function biru_site_social() { $nwp_facebook = esc_url( biru_get_option( 'facebook' ) ); $nwp_twitter = esc_url( biru_get_option( 'twitter' ) ); $nwp_googleplus = esc_url( biru_get_option( 'googleplus' ) ); $nwp_tumblr = esc_url( biru_get_option( 'tumblr' ) ); $nwp_instagram = esc_url( biru_get_option( 'instagram' ) ); $nwp_youtube = esc_url( biru_get_option( 'youtube' ) ); $nwp_pinterest = esc_url( biru_get_option( 'pinterest' ) ); echo ''; } /* Display header search form. ------------------------------------------------------*/ function biru_site_search() { echo ''; } /*-----------------------------------------------------------------------------------*/ /* Returns the Google fonts stylesheet URL, if available. /* ----------------------------------------------------------------------------------*/ function biru_fonts_url() { $fonts_url = ''; /* Open Sans. -------------------------------------------------------------------*/ $font1 = _x( 'on', 'Open Sans font: on or off', 'biru' ); /* Quicksand. -------------------------------------------------------------------*/ $font2 = _x( 'on', 'Quicksand font: on or off', 'biru' ); if ( 'off' !== $font1 || 'off' !== $font2 ) { $font_families = array(); if ( 'off' !== $font1 ) $font_families[] = 'Open Sans:300,400,600,700,800,400italic,700italic'; if ( 'off' !== $font2 ) $font_families[] = 'Quicksand:300,400,700'; $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 scripts and styles /* ----------------------------------------------------------------------------------*/ /* Enqueue scripts. -----------------------------------------------------------------*/ function biru_scripts() { wp_enqueue_script( 'biru-bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array( 'jquery' ), '', true ); wp_enqueue_script( 'biru-scripts', get_template_directory_uri() . '/assets/js/scripts.js', false, '1.0', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'biru_scripts' ); /* Enqueue styles. ------------------------------------------------------------------*/ function biru_styles() { wp_enqueue_style( 'biru-bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css' ); wp_enqueue_style( 'biru-icons', get_template_directory_uri() . '/assets/css/themify-icons.css' ); wp_enqueue_style( 'biru-fonts', biru_fonts_url() ); wp_enqueue_style( 'biru-style', get_stylesheet_uri() ); } add_action( 'wp_enqueue_scripts', 'biru_styles' ); /*-----------------------------------------------------------------------------------*/ /* Custom functions /* ----------------------------------------------------------------------------------*/ require_once get_template_directory() . '/includes/neowp-template-tags.php'; require_once get_template_directory() . '/includes/neowp-custom-widgets.php'; require_once get_template_directory() . '/includes/neowp-walker-comment.php'; require_once get_template_directory() . '/includes/neowp-walker-menu.php'; require_once get_template_directory() . '/includes/neowp-customizer.php';