0 ){ foreach( $module_files as $file ){ require_once get_theme_file_path( $base . $module . '/' . $file ); } } } } } $bizart_modules = array( 'breadcrumb', 'css', 'customizer', 'fields', 'scripts', 'tgm', 'theme-setup' ); bizart_module_loader( $bizart_modules ); /** * Google fonts array * @since Bizart 1.0 */ if( !function_exists( 'bizart_get_fonts' ) ){ function bizart_get_fonts(){ $fonts = array( 'lato' => array( 'family' => 'Lato', 'weight' => '100,200,300,500' ), 'oswald' => array( 'family' => 'Oswald', 'weight' => '' ), 'monsterrat' => array( 'family' => 'Montserrat', 'weight' => '100,200,300' ), 'roboto' => array( 'family' => 'Roboto', 'weight' => '' ), 'raleway' => array( 'family' => 'Raleway', 'weight' => '' ), 'playfair' => array( 'family' => 'Playfair Display', 'weight' => '' ), 'fjalla-one' => array( 'family' => 'Fjalla One', 'weight' => '' ), 'alegreya' => array( 'family' => 'Alegreya Sans', 'weight' => '' ), 'pt-sans-narrow' => array( 'family' => 'PT Sans Narrow', 'weight' => '' ), 'open-sans' => array( 'family' => 'Open Sans', 'weight' => '100,200,300,400' ), 'poppins' => array( 'family' => 'Poppins', 'weight' => '400,500,600,700,800' ), 'hind' => array( 'family' => 'Hind', 'weight' => '400,500,600,700,800' ), 'quicksand' => array( 'family' => 'Quicksand', 'weight' => '400,500,600,700,800' ) ); return apply_filters( 'bizart_standard_fonts', $fonts ); } } /** * Generate google font url * @since Bizart 1.0 */ if( !function_exists( 'bizart_generate_font_url' ) ){ function bizart_generate_font_url(){ $fonts = bizart_get_fonts(); $url = '//fonts.googleapis.com/css?family='; foreach( $fonts as $key => $font ){ $url .= $font[ 'family' ]; if( '' != $font[ 'weight' ] ){ $url .= ':' . $font[ 'weight' ]; } $url .= '|'; } $url = rtrim( $url, '|' ); $url .= '&display=swap'; return $url; } } /** * Returns schema text * @since Bizart 1.0 */ if( !function_exists( 'bizart_schema' ) ){ function bizart_schema( $type ) { $schema = ''; switch ($type) { case 'body' : # Check conditions. $is_blog = ( is_home() || is_archive() || is_attachment() || is_tax() || is_single() ) ? true : false; # Set up default itemtype. $itemtype = 'WebPage'; # Get itemtype for the blog. $itemtype = ( $is_blog ) ? 'Blog' : $itemtype; # Get itemtype for search results. $itemtype = ( is_search() ) ? 'SearchResultsPage' : $itemtype; $schema = "itemtype='https://schema.org/{$itemtype}' itemscope='itemscope' "; break; case 'header' : $schema = "itemtype='https://schema.org/WPHeader' itemscope='itemscope' role='banner' "; break; case 'footer' : $schema = "itemtype='https://schema.org/WPFooter' itemscope='itemscope' role='contentinfo'"; break; case 'article': $schema = "itemtype='https://schema.org/CreativeWork' itemscope='itemscope'"; break; default : break; } return apply_filters( "bizart_schema_{$type}", $schema ); } } /** * Returns permalink of date archive page * @since Bizart 1.0 */ if( !function_exists( 'bizart_get_day_link' ) ){ function bizart_get_day_link(){ return get_day_link( get_the_time('Y'), get_the_time('m'), get_the_time('d') ); } } /** * Use front-page.php when Front page displays is set to a static page. * @since Bizart 1.0 */ function bizart_front_page_template( $template ) { return is_home() ? '' : $template; } add_filter( 'frontpage_template', 'bizart_front_page_template' ); /** * Returns alternative text for thumbnail * @since Bizart 1.0 */ if(! function_exists( 'bizart_get_the_post_thumbnail_text' ) ){ function bizart_get_the_post_thumbnail_text(){ $thumb_id = get_post_thumbnail_id( get_the_ID() ); return get_post_meta( $thumb_id, '_wp_attachment_image_alt', true ); } } /** * Returns permalink of blog page * @since Bizart 1.0 */ if( ! function_exists( 'bizart_get_blog_page_url' ) ){ function bizart_get_blog_page_url() { // If front page is set to display a static page, get the URL of the posts page. if ( 'page' === get_option( 'show_on_front' ) ) { return get_permalink( get_option( 'page_for_posts' ) ); } // The front page IS the posts page. Get its URL. return get_home_url(); } } /** * Order for frontpage content * @since Bizart 1.0 */ if( !function_exists( 'bizart_get_content_order' ) ){ function bizart_get_content_order(){ $order = array( 'slider', 'service', 'partner', 'team', 'testimonial', 'blog', 'cta', 'contact' ); return apply_filters( 'bizart_content_order', $order ); } } /** * Separate pipe from title * @since Bizart 1.0 */ if( !function_exists( 'bizart_get_piped_title' ) ){ function bizart_get_piped_title(){ $heading = get_the_title(); $heading = explode( '', $heading ); $data = array( '', '' ); if( isset( $heading[0] ) ){ $data[0] = $heading[0]; } if( isset( $heading[1] ) ){ $data[1] = str_replace( '', '', $heading[1] ); } return $data; } } /** * Returns alternative text for thumbnail * @since Bizart 1.0 */ if(! function_exists( 'bizart_frontpage_title' ) ){ function bizart_frontpage_title( $setting ){ $page_id = bizart_get( "{$setting}-page" ); if( $page_id ){ $query = new WP_Query(array( 'page_id' => absint( $page_id ) )); $sub_text = bizart_get( "{$setting}-sub-text" ); if( $query->have_posts() ){ while( $query->have_posts() ){ $query->the_post(); ?>