false, 'header-text' => false, ) ); add_theme_support( 'custom-logo', array( 'height' => 100, 'width' => 100, 'flex-height' => true, ) ); register_nav_menus( array( 'primary' => __( 'Primary Menu', 'building-contractor' ), ) ); add_theme_support( 'custom-background', array( 'default-color' => 'ffffff' ) ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); /* * Enable support for Post Formats. */ add_theme_support( 'post-formats', array('image','video','gallery','audio',) ); add_editor_style( 'editor-style.css' ); } endif; // building_contractor_setup add_action( 'after_setup_theme', 'building_contractor_setup' ); function building_contractor_the_breadcrumb() { echo ''; } function building_contractor_widgets_init() { register_sidebar( array( 'name' => __( 'Blog Sidebar', 'building-contractor' ), 'description' => __( 'Appears on blog page sidebar', 'building-contractor' ), 'id' => 'sidebar-1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Page Sidebar', 'building-contractor' ), 'id' => 'sidebar-2', 'description' => __( 'Add widgets here to appear in your sidebar on pages.', 'building-contractor' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Sidebar 3', 'building-contractor' ), 'id' => 'sidebar-3', 'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'building-contractor' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer Widget 1', 'building-contractor' ), 'description' => __( 'Appears on footer', 'building-contractor' ), 'id' => 'footer-1', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => __( 'Footer Widget 2', 'building-contractor' ), 'description' => __( 'Appears on footer', 'building-contractor' ), 'id' => 'footer-2', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => __( 'Footer Widget 3', 'building-contractor' ), 'description' => __( 'Appears on footer', 'building-contractor' ), 'id' => 'footer-3', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar( array( 'name' => __( 'Footer Widget 4', 'building-contractor' ), 'description' => __( 'Appears on footer', 'building-contractor' ), 'id' => 'footer-4', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); register_sidebar(array( 'name' => __('Shop Sidebar', 'building-contractor'), 'description' => __('Sidebar for WooCommerce shop pages', 'building-contractor'), 'id' => 'woocommerce_sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Single Product Sidebar', 'building-contractor'), 'description' => __('Sidebar for single product pages', 'building-contractor'), 'id' => 'woocommerce-single-sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', )); } add_action( 'widgets_init', 'building_contractor_widgets_init' ); // Change number of products per row to 3 add_filter('loop_shop_columns', 'building_contractor_loop_columns'); if (!function_exists('building_contractor_loop_columns')) { function building_contractor_loop_columns() { $colm = get_theme_mod('building_contractor_products_per_row', 3); // Default to 3 if not set return $colm; } } // Use the customizer setting to set the number of products per page function building_contractor_products_per_page($cols) { $cols = get_theme_mod('building_contractor_products_per_page', 9); // Default to 9 if not set return $cols; } add_filter('loop_shop_per_page', 'building_contractor_products_per_page', 9); /* Theme Font URL */ function building_contractor_font_url() { $font_family = array( 'Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'Fjalla One', 'PT Sans:ital,wght@0,400;0,700;1,400;1,700', 'PT Serif:ital,wght@0,400;0,700;1,400;1,700', 'Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900', 'Roboto Condensed:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700', 'Alex Brush', 'Overpass:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'Playball', 'Alegreya:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900', 'Julius Sans One', 'Arsenal:ital,wght@0,400;0,700;1,400;1,700', 'Slabo 13px', 'Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900', 'Overpass Mono:wght@300;400;500;600;700', 'Source Sans Pro:ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900', 'Raleway:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900', 'Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700', 'Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700', 'Cabin:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700', 'Arimo:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700', 'Playfair Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900', 'Quicksand:wght@300;400;500;600;700', 'Padauk:wght@400;700', 'Mulish:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;0,1000;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900;1,1000', 'Inconsolata:wght@200;300;400;500;600;700;800;900&family=Mulish:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;0,1000;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900;1,1000', 'Bitter:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'Pacifico', 'Indie Flower', 'VT323', 'Dosis:wght@200;300;400;500;600;700;800', 'Frank Ruhl Libre:wght@300;400;500;700;900', 'Fjalla One', 'Oxygen:wght@300;400;700', 'Arvo:ital,wght@0,400;0,700;1,400;1,700', 'Noto Serif:ital,wght@0,400;0,700;1,400;1,700', 'Lobster', 'Crimson Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700', 'Yanone Kaffeesatz:wght@200;300;400;500;600;700', 'Anton', 'Libre Baskerville:ital,wght@0,400;0,700;1,400', 'Bree Serif', 'Gloria Hallelujah', 'Abril Fatface', 'Varela Round', 'Vampiro One', 'Shadows Into Light', 'Cuprum:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700', 'Rokkitt:wght@100;200;300;400;500;600;700;800;900', 'Vollkorn:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,600;1,700;1,800;1,900', 'Francois One', 'Orbitron:wght@400;500;600;700;800;900', 'Patua One', 'Acme', 'Satisfy', 'Josefin Slab:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700', 'Quattrocento Sans:ital,wght@0,400;0,700;1,400;1,700', 'Architects Daughter', 'Russo One', 'Monda:wght@400;700', 'Righteous', 'Lobster Two:ital,wght@0,400;0,700;1,400;1,700', 'Hammersmith One', 'Courgette', 'Permanent Marke', 'Cherry Swash:wght@400;700', 'Cormorant Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700', 'Poiret One', 'BenchNine:wght@300;400;700', 'Economica:ital,wght@0,400;0,700;1,400;1,700', 'Handlee', 'Cardo:ital,wght@0,400;0,700;1,400', 'Alfa Slab One', 'Averia Serif Libre:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700', 'Cookie', 'Chewy', 'Great Vibes', 'Coming Soon', 'Philosopher:ital,wght@0,400;0,700;1,400;1,700', 'Days One', 'Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'Shrikhand', 'Tangerine:wght@400;700', 'IM Fell English SC', 'Boogaloo', 'Bangers', 'Fredoka One', 'Bad Script', 'Volkhov:ital,wght@0,400;0,700;1,400;1,700', 'Shadows Into Light Two', 'Marck Script', 'Sacramento', 'Unica One', 'Dancing Script:wght@400;500;600;700', 'Exo 2:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'Archivo:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'Jost:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900', 'DM Serif Display', 'Open Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800', 'Josefin Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700' ); $query_args = array( 'family' => rawurlencode(implode('|',$font_family)), ); $font_url = add_query_arg($query_args,'//fonts.googleapis.com/css'); return $font_url; $contents = wptt_get_webfont_url( esc_url_raw( $fonts_url ) ); } function building_contractor_scripts() { wp_enqueue_style( 'building-contractor-font', building_contractor_font_url(), array() ); wp_enqueue_style( 'bootstrap-css', esc_url(get_template_directory_uri())."/css/bootstrap.css" ); wp_enqueue_style('building-contractor-style', get_stylesheet_uri(), array() ); wp_style_add_data('building-contractor-style', 'rtl', 'replace'); require get_parent_theme_file_path( '/inc/color-scheme/custom-color-control.php' ); wp_add_inline_style( 'building-contractor-style',$building_contractor_color_scheme_css ); wp_enqueue_style( 'owl.carousel-css', esc_url(get_template_directory_uri())."/css/owl.carousel.css" ); wp_enqueue_style( 'building-contractor-default', esc_url(get_template_directory_uri())."/css/default.css" ); wp_enqueue_style( 'building-contractor-style', get_stylesheet_uri() ); wp_enqueue_script( 'owl.carousel-js', esc_url(get_template_directory_uri()). '/js/owl.carousel.js', array('jquery') ); wp_enqueue_script( 'bootstrap-js', esc_url(get_template_directory_uri()). '/js/bootstrap.js', array('jquery') ); wp_enqueue_script( 'building-contractor-theme', esc_url(get_template_directory_uri()) . '/js/theme.js' ); wp_enqueue_style( 'font-awesome-css', esc_url(get_template_directory_uri())."/css/fontawesome-all.css" ); wp_enqueue_style( 'building-contractor-block-style', esc_url( get_template_directory_uri() ).'/css/blocks.css' ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // font-family $building_contractor_headings_font = esc_html(get_theme_mod('building_contractor_headings_fonts')); $building_contractor_body_font = esc_html(get_theme_mod('building_contractor_body_fonts')); // Body $building_contractor_body_font = esc_html(get_theme_mod('building_contractor_body_fonts')); // Paragraph $building_contractor_paragraph_font_family = get_theme_mod('building_contractor_paragraph_font_family', ''); // "a" tag $building_contractor_atag_font_family = get_theme_mod('building_contractor_atag_font_family', ''); // "li" tag $building_contractor_li_font_family = get_theme_mod('building_contractor_li_font_family', ''); // H1 $building_contractor_h1_font_family = get_theme_mod('building_contractor_h1_font_family', ''); // H2 $building_contractor_h2_font_family = get_theme_mod('building_contractor_h2_font_family', ''); // H3 $building_contractor_h3_font_family = get_theme_mod('building_contractor_h3_font_family', ''); // H4 $building_contractor_h4_font_family = get_theme_mod('building_contractor_h4_font_family', ''); // H5 $building_contractor_h5_font_family = get_theme_mod('building_contractor_h5_font_family', ''); // H6 $building_contractor_h6_font_family = get_theme_mod('building_contractor_h6_font_family', ''); if ($building_contractor_headings_font) { wp_enqueue_style('building-contractor-headings-fonts', 'https://fonts.googleapis.com/css?family=' . urlencode($building_contractor_headings_font)); } else { wp_enqueue_style('montserrat-headings', 'https://fonts.googleapis.com/css?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900'); } if ($building_contractor_body_font) { wp_enqueue_style('building-contractor-body-fonts', 'https://fonts.googleapis.com/css?family=' . urlencode($building_contractor_body_font)); } else { wp_enqueue_style('montserrat-body', 'https://fonts.googleapis.com/css?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900'); } // body $building_contractor_body_font_family = get_theme_mod('building_contractor_body_font_family', ''); $building_contractor_color_scheme_css = ' body{ font-family: '.esc_html($building_contractor_body_font_family).'; } p,span{ font-family: '.esc_html($building_contractor_paragraph_font_family).'; } a{ font-family: '.esc_html($building_contractor_atag_font_family).'; } li{ font-family: '.esc_html($building_contractor_li_font_family).'; } h1{ font-family: '.esc_html($building_contractor_h1_font_family).'!important; } h2{ font-family: '.esc_html($building_contractor_h2_font_family).'!important; } h3{ font-family: '.esc_html($building_contractor_h3_font_family).'!important; } h4{ font-family: '.esc_html($building_contractor_h4_font_family).'!important; } h5{ font-family: '.esc_html($building_contractor_h5_font_family).'!important; } h6{ font-family: '.esc_html($building_contractor_h6_font_family).'!important; } '; wp_add_inline_style('building-contractor-style', $building_contractor_color_scheme_css); } add_action( 'wp_enqueue_scripts', 'building_contractor_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'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Sanitization Callbacks. */ require get_template_directory() . '/inc/sanitization-callbacks.php'; /** * Webfont-Loader. */ require get_template_directory() . '/inc/wptt-webfont-loader.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/upgrade-to-pro.php'; /** * select . */ require get_template_directory() . '/inc/select/category-dropdown-custom-control.php'; /** * Theme Info Page. */ require get_template_directory() . '/inc/addon.php'; /** * Theme Info Page. */ if ( ! defined( 'BUILDING_CONTRACTOR_PRO_NAME' ) ) { define( 'BUILDING_CONTRACTOR_PRO_NAME', __( 'About Building Contractor', 'building-contractor' )); } if ( ! defined( 'BUILDING_CONTRACTOR_THEME_PAGE' ) ) { define('BUILDING_CONTRACTOR_THEME_PAGE',__('https://www.theclassictemplates.com/collections/best-wordpress-templates','building-contractor')); } if ( ! defined( 'BUILDING_CONTRACTOR_SUPPORT' ) ) { define('BUILDING_CONTRACTOR_SUPPORT',__('https://wordpress.org/support/theme/building-contractor/','building-contractor')); } if ( ! defined( 'BUILDING_CONTRACTOR_REVIEW' ) ) { define('BUILDING_CONTRACTOR_REVIEW',__('https://wordpress.org/support/theme/building-contractor/reviews/#new-post','building-contractor')); } if ( ! defined( 'BUILDING_CONTRACTOR_PRO_DEMO' ) ) { define('BUILDING_CONTRACTOR_PRO_DEMO',__('https://live.theclassictemplates.com/building-contractor-shop-pro/','building-contractor')); } if ( ! defined( 'BUILDING_CONTRACTOR_PREMIUM_PAGE' ) ) { define('BUILDING_CONTRACTOR_PREMIUM_PAGE',__('https://www.theclassictemplates.com/products/building-contractor-wordpress-theme','building-contractor')); } if ( ! defined( 'BUILDING_CONTRACTOR_THEME_DOCUMENTATION' ) ) { define('BUILDING_CONTRACTOR_THEME_DOCUMENTATION',__('https://live.theclassictemplates.com/demo/docs/building-contractor-shop-free','building-contractor')); } /* Starter Content */ add_theme_support( 'starter-content', array( 'widgets' => array( 'footer-1' => array( 'categories', ), 'footer-2' => array( 'archives', ), 'footer-3' => array( 'meta', ), 'footer-4' => array( 'search', ), ), )); if ( ! function_exists( 'building_contractor_the_custom_logo' ) ) : /** * Displays the optional custom logo. * * Does nothing if the custom logo is not available. * */ function building_contractor_the_custom_logo() { if ( function_exists( 'the_custom_logo' ) ) { the_custom_logo(); } } endif; /*-- Custom metafield --*/ function building_contractor_custom_price() { add_meta_box( 'bn_meta', __( 'Building Contractor Meta Fields', 'building-contractor' ), 'building_contractor_render_custom_icon_meta_field', 'post', 'normal', 'high' ); } if (is_admin()){ add_action('admin_menu', 'building_contractor_custom_price'); } function building_contractor_render_custom_icon_meta_field($post) { wp_nonce_field(basename(__FILE__), 'building_contractor_custom_icon_meta_nonce'); $custom_icon_value = get_post_meta($post->ID, 'building_contractor_custom_icon', true); ?>