' . "\n"; } endif; add_action( 'wp_head', 'bizznis_load_favicon' ); /** * Echo favicon link if one is found. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_load_favicon' ) ) : function bizznis_load_favicon( $favicon = '' ) { # Allow child theme to short-circuit this function $pre = apply_filters( 'bizznis_pre_load_favicon', false ); if ( $pre !== false ) { $favicon = $pre; } elseif ( file_exists( CHILD_DIR . '/images/favicon.ico' ) ) { $favicon = CHILD_URL . '/images/favicon.ico'; } elseif ( file_exists( CHILD_DIR . '/images/favicon.gif' ) ) { $favicon = CHILD_URL . '/images/favicon.gif'; } elseif ( file_exists( CHILD_DIR . '/images/favicon.png' ) ) { $favicon = CHILD_URL . '/images/favicon.png'; } elseif ( file_exists( CHILD_DIR . '/images/favicon.jpg' ) ) { $favicon = CHILD_URL . '/images/favicon.jpg'; } # URL to favicon is filtered via 'bizznis_favicon_url' before being echoed. $favicon = apply_filters( 'bizznis_favicon_url', $favicon ); if ( $favicon ) { echo '' . "\n"; } } endif; add_action( 'wp_head', 'bizznis_do_meta_pingback' ); /** * Adds the pingback meta tag to the head so that other sites can know how to send a pingback to our site. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_do_meta_pingback' ) ) : function bizznis_do_meta_pingback() { echo '' . "\n"; } endif; add_action( 'wp_head', 'bizznis_paged_rel' ); /** * Output rel links in the head to indicate previous and next pages in paginated archives and posts. * * @link http://googlewebmastercentral.blogspot.com/2011/09/pagination-with-relnext-and-relprev.html * * @since 1.2.2 */ if ( ! function_exists( 'bizznis_paged_rel' ) ) : function bizznis_paged_rel() { global $wp_query; $prev = $next = ''; $paged = intval( get_query_var( 'paged' ) ); $page = intval( get_query_var( 'page' ) ); if ( ! is_singular() ) { $prev = $paged > 1 ? get_previous_posts_page_link() : $prev; $next = $paged < $wp_query->max_num_pages ? get_next_posts_page_link() : $next; } else { //* No need for this on previews if ( is_preview() ) { return ''; } $numpages = substr_count( $wp_query->post->post_content, '' ) + 1; if ( $numpages && ! $page ) { $page = 1; } if ( $page > 1 ) { $prev = bizznis_paged_post_url( $page - 1 ); } if ( $page < $numpages ) { $next = bizznis_paged_post_url( $page + 1 ); } } if ( $prev ) { printf( '' . "\n", esc_url( $prev ) ); } if ( $next ) { printf( '' . "\n", esc_url( $next ) ); } } endif; add_action( 'wp_head', 'bizznis_meta_name' ); /** * Output meta tag for site name. * * @since 1.2.2 */ if ( ! function_exists( 'bizznis_meta_name' ) ) : function bizznis_meta_name() { printf( '' . "\n", get_bloginfo( 'name' ) ); } endif; add_filter( 'bizznis_header_scripts', 'do_shortcode' ); add_action( 'wp_head', 'bizznis_header_scripts' ); /** * Echo header scripts in to wp_head(). * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_header_scripts' ) ) : function bizznis_header_scripts() { # Applies 'bizznis_header_scripts' filter on value stored in header_scripts setting. echo apply_filters( 'bizznis_header_scripts', bizznis_get_option( 'header_scripts' ) ); # If singular, echo scripts from custom field if ( is_singular() ) { bizznis_custom_field( '_bizznis_scripts' ); } } endif; add_action( 'after_setup_theme', 'bizznis_custom_header' ); /** * Activate the custom header feature. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_custom_header' ) ) : function bizznis_custom_header() { $wp_custom_header = get_theme_support( 'custom-header' ); # Stop here if not active (Bizznis of WP custom header) if ( ! $wp_custom_header ) { return; } # Blog title option is obsolete when custom header is active add_filter( 'bizznis_pre_get_option_blog_title', '__return_empty_array' ); } endif; add_action( 'bizznis_css', 'bizznis_custom_header_style' ); /** * Custom header callback. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_custom_header_style' ) ) : function bizznis_custom_header_style() { # Stop here if custom header not supported if ( ! current_theme_supports( 'custom-header' ) ) { return; } # Stop here if user specifies their own callback if ( get_theme_support( 'custom-header', 'wp-head-callback' ) ) { return; } # Output nothing if header style isn't present. $output = ''; $header_image = get_header_image(); $text_color = get_header_textcolor(); # If no options set, don't waste the output. Stop here. if ( empty( $header_image ) && ! display_header_text() && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) ) { return; } $header_selector = get_theme_support( 'custom-header', 'header-selector' ); $title_selector = '.custom-header .site-title'; $desc_selector = '.custom-header .site-description'; # Header selector fallback if ( ! $header_selector ) { $header_selector = '.custom-header .title-area'; } # Header image CSS, if exists if ( $header_image ) { bizznis_get_css()->add( array( 'selectors' => array( $header_selector ), 'declarations' => array( 'background-image' => 'url("' . esc_url( $header_image ) . '")', 'background-repeat' => 'no-repeat', 'background-position' => 'center center', ) ) ); } # Header text color CSS, if showing text if ( display_header_text() && $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) { bizznis_get_css()->add( array( 'selectors' => array( $title_selector . ' a', $title_selector . ' a:hover', $desc_selector ), 'declarations' => array( 'color' => bizznis_add_string_filter( 'maybe_hash_hex_color', $text_color ), ) ) ); } } endif; add_action( 'bizznis_site_title', 'bizznis_site_title' ); /** * Echo the site title into the header. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_site_title' ) ) : function bizznis_site_title() { # Stop here if title is hiden if ( bizznis_get_option( 'hide_site_title' ) ) { return; } # Set what goes inside the wrapping tags $inside = sprintf( '%s', trailingslashit( home_url() ), get_bloginfo( 'name' ) ); # Determine which wrapping tags to use $wrap = is_home() ? 'h1' : 'p'; $wrap = apply_filters( 'bizznis_semantic_title_wrap', $wrap ); # Build the title $title = sprintf( "<{$wrap} %s>", bizznis_attr( 'site-title' ) ). $inside ."{$wrap}>"; # Echo (filtered) echo apply_filters( 'bizznis_seo_title', $title, $inside, $wrap ); } endif; add_action( 'bizznis_site_title', 'bizznis_site_description' ); /** * Echo the site description into the header. * * @since 1.0.0 */ if ( ! function_exists( 'bizznis_site_description' ) ) : function bizznis_site_description() { # Stop here if tagline is hiden if ( bizznis_get_option( 'hide_tagline' ) ) { return; } # Set what goes inside the wrapping tags $inside = esc_html( get_bloginfo( 'description' ) ); # Determine which wrapping tags to use $wrap = apply_filters( 'bizznis_semantic_description_wrap', 'p' ); # Build the description $description = sprintf( "<{$wrap} %s>", bizznis_attr( 'site-description' ) ). $inside ."{$wrap}>"; # Output (filtered) $output = $inside ? apply_filters( 'bizznis_seo_description', $description, $inside, $wrap ) : ''; echo $output; } endif; add_action( 'bizznis_after_site_title', 'bizznis_header_widget_area' ); /** * Echo the header widgets into the header. * * @since 1.1.8 */ if ( ! function_exists( 'bizznis_header_widget_area' ) ) : function bizznis_header_widget_area() { global $wp_registered_sidebars; if ( ( isset( $wp_registered_sidebars['header-aside'] ) && is_active_sidebar( 'header-aside' ) ) || has_action( 'bizznis_header_aside' ) ) { printf( '