__( 'Header', 'bzoago' ) ] ); register_nav_menus( [ 'menu-2' => __( 'Footer', 'bzoago' ) ] ); } $hook_result = apply_filters_deprecated( 'elementor_bzoago_theme_add_theme_support', [ true ], '1.0', 'bzoago_elementor_add_theme_support' ); if ( apply_filters( 'bzoago_elementor_add_theme_support', $hook_result ) ) { add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) ); add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat')); add_theme_support( 'woocommerce' ); remove_theme_support( 'widgets-block-editor' ); // for gutenberg support add_theme_support( 'align-wide' ); add_theme_support( 'editor-color-palette', array( array( 'name' => esc_html__( 'dark blue', 'bzoago' ), 'slug' => 'bzoago-button-dark-blue', 'color' => '#5a49f8', ), array( 'name' => esc_html__( 'light blue', 'bzoago' ), 'slug' => 'bzoago-button-light-blue', 'color' => '#7a64f2', ), array( 'name' => esc_html__( 'Dark violet', 'bzoago' ), 'slug' => 'bzoago-button-dark-violet', 'color' => '#750ed5', ), array( 'name' => esc_html__( 'light gray', 'bzoago' ), 'slug' => 'bzoago-button-light-gray', 'color' => '#3e3e3e', ), array( 'name' => esc_html__( 'white', 'bzoago' ), 'slug' => 'bzoago-button-white', 'color' => '#ffffff', ), ) ); add_theme_support( 'editor-font-sizes', array( array( 'name' => esc_html__( 'Small', 'bzoago' ), 'size' => 12, 'slug' => 'small' ), array( 'name' => esc_html__( 'Normal', 'bzoago' ), 'size' => 16, 'slug' => 'normal' ), array( 'name' => esc_html__( 'Large', 'bzoago' ), 'size' => 36, 'slug' => 'large' ), array( 'name' => esc_html__( 'Huge', 'bzoago' ), 'size' => 50, 'slug' => 'huge' ) ) ); $defaults = array( 'height' => 100, 'width' => 400, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), 'unlink-homepage-logo' => true, ); add_theme_support( 'custom-logo', $defaults ); $defaults_header = array( 'default-image' => '', 'width' => 0, 'height' => 0, 'flex-height' => false, 'flex-width' => false, 'uploads' => true, 'random-default' => false, 'header-text' => true, 'default-text-color' => '', 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); add_theme_support( 'custom-header', $defaults_header ); $defaults_background = array( 'default-color' => '', 'default-image' => '', 'default-repeat' => 'repeat', 'default-position-x' => 'left', 'default-position-y' => 'top', 'default-size' => 'auto', 'default-attachment' => 'scroll', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $defaults_background ); add_theme_support( 'wp-block-styles' ); add_theme_support( 'responsive-embeds' ); add_theme_support( 'editor-styles'); // add_theme_support( "custom-logo", $args ) ; // add_theme_support( "custom-header", $args ); // add_theme_support( "custom-background", $args ); // Image sizes add_image_size( 'bzoago-size1', 1210, 660, true ); // Single Post , Blog layout 2 add_image_size( 'bzoago-size2', 1210, 786, true ); // Gallery single add_image_size( 'bzoago-size3', 530, 400, true ); // Blog layout 1, 3 add_image_size( 'bzoago-size4', 810, 442, true ); // Blog layout 2 add_image_size( 'bzoago-size5', 520, 562, true ); // Team grid add_image_size( 'bzoago-size6', 442, 500, true ); // Gallery layout 1, 2 add_image_size( 'bzoago-size7', 640, 471, true ); // Gallery isotop 3 add_image_size( 'bzoago-size8', 640, 416, true ); // Gallery isotop 3 add_image_size( 'bzoago-size9', 410, 730, true ); // App Screenshot grid // // Register menus register_nav_menus( array( 'additional-menu' => __( 'Menu-Blog', 'bzoago' ) ) ); /* * Editor Style. */ add_editor_style( 'classic-editor.css' ); /* * Gutenberg wide images. */ add_theme_support( 'align-wide' ); /* * WooCommerce. */ $hook_result = apply_filters_deprecated( 'elementor_bzoago_theme_add_woocommerce_support', [ true ], '2.0', 'bzoago_elementor_add_woocommerce_support' ); if ( apply_filters( 'bzoago_elementor_add_woocommerce_support', $hook_result ) ) { // WooCommerce in general. add_theme_support( 'woocommerce' ); // Enabling WooCommerce product gallery features (are off by default since WC 3.0.0). // zoom. add_theme_support( 'wc-product-gallery-zoom' ); // lightbox. add_theme_support( 'wc-product-gallery-lightbox' ); // swipe. add_theme_support( 'wc-product-gallery-slider' ); } } } } add_action( 'after_setup_theme', 'bzoago_elementor_setup' ); function bzoago_maybe_update_theme_version_in_db() { $theme_version_option_name = 'bzoago_theme_version'; // The theme version saved in the database. $bzoago_theme_db_version = get_option( $theme_version_option_name ); // If the 'bzoago_theme_version' option does not exist in the DB, or the version needs to be updated, do the update. if ( ! $bzoago_theme_db_version || version_compare( $bzoago_theme_db_version, bzoago_ELEMENTOR_VERSION, '<' ) ) { update_option( $theme_version_option_name, bzoago_ELEMENTOR_VERSION ); } } if ( ! function_exists( 'bzoago_elementor_scripts_styles' ) ) { /** * Theme Scripts & Styles. * * @return void */ function bzoago_elementor_scripts_styles() { $enqueue_basic_style = apply_filters_deprecated( 'elementor_bzoago_theme_enqueue_style', [ true ], '2.0', 'bzoago_elementor_enqueue_style' ); $min_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; if ( apply_filters( 'bzoago_elementor_enqueue_style', $enqueue_basic_style ) ) { wp_enqueue_style( 'bzoago', get_template_directory_uri() . '/style.css', [], bzoago_ELEMENTOR_VERSION ); } if ( apply_filters( 'bzoago_elementor_enqueue_theme_style', true ) ) { wp_enqueue_style( 'bzoago-theme-style', get_template_directory_uri() . '/theme.css', [], bzoago_ELEMENTOR_VERSION ); } wp_register_style( 'font-awesome-style', BZOTech_ASSETS_URL . 'font-awesome/css/fontawesome.min.css', array(), '1.0.0', 'all'); wp_enqueue_style( 'font-awesome-style' ); wp_register_style( 'font-awesome-brand', BZOTech_ASSETS_URL . 'font-awesome/css/brands.min.css', array(), '1.0.0', 'all'); wp_enqueue_style( 'font-awesome-brand' ); wp_enqueue_style( 'bzoago-style', BZOTech_CSS_URL . 'style.css', [], bzoago_ELEMENTOR_VERSION); wp_enqueue_style('responsive', BZOTech_CSS_URL . 'reponsive.css', [], bzoago_ELEMENTOR_VERSION); wp_register_style( 'rtl-style', BZOTech_CSS_URL . 'rtl.css', [], bzoago_ELEMENTOR_VERSION); wp_enqueue_style( 'rtl-style' ); wp_enqueue_script( 'ajax-themes', BZOTech_JS_URL . '/jquery.min.js', array(), '5.8.3', true ); wp_enqueue_script( 'main-themes', BZOTech_JS_URL . '/main.js', array(), '5.8.3', true ); } } add_action( 'wp_enqueue_scripts', 'bzoago_elementor_scripts_styles' ); if ( ! function_exists( 'bzoago_elementor_register_elementor_locations' ) ) { /** * Register Elementor Locations. * * @param ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager $elementor_theme_manager theme manager. * * @return void */ function bzoago_elementor_register_elementor_locations( $elementor_theme_manager ) { $hook_result = apply_filters_deprecated( 'elementor_bzoago_theme_register_elementor_locations', [ true ], '2.0', 'bzoago_elementor_register_elementor_locations' ); if ( apply_filters( 'bzoago_elementor_register_elementor_locations', $hook_result ) ) { $elementor_theme_manager->register_all_core_location(); } } } add_action( 'elementor/theme/register_locations', 'bzoago_elementor_register_elementor_locations' ); if ( ! function_exists( 'bzoago_elementor_content_width' ) ) { /** * Set default content width. * * @return void */ function bzoago_elementor_content_width() { $GLOBALS['content_width'] = apply_filters( 'bzoago_elementor_content_width', 800 ); } } add_action( 'after_setup_theme', 'bzoago_elementor_content_width', 0 ); if ( is_admin() ) { require get_template_directory() . '/includes/admin-functions.php'; } /** * If Elementor is installed and active, we can load the Elementor-specific Settings & Features */ // Allow active/inactive via the Experiments require get_template_directory() . '/includes/elementor-functions.php'; // * // * Include customizer registration functions if ( ! function_exists( 'bzoago_elementor_check_hide_title' ) ) { /** * Check hide title. * * @param bool $val default value. * * @return bool */ function bzoago_elementor_check_hide_title( $val ) { if ( defined( 'ELEMENTOR_VERSION' ) ) { $current_doc = Elementor\Plugin::instance()->documents->get( get_the_ID() ); if ( $current_doc && 'yes' === $current_doc->get_settings( 'hide_title' ) ) { $val = false; } } return $val; } } add_filter( 'bzoago_elementor_page_title', 'bzoago_elementor_check_hide_title' ); /** * Wrapper function to deal with backwards compatibility. */ if ( ! function_exists( 'bzoago_elementor_body_open' ) ) { function bzoago_elementor_body_open() { if ( function_exists( 'wp_body_open' ) ) { wp_body_open(); } else { do_action( 'wp_body_open' ); } } } function disable_plugin_updates( $value ) { $pluginsToDisable = [ 'ajax-login-and-registration-modal-popup/ajax-login-registration-modal-popup.php', ]; if ( isset($value) && is_object($value) ) { foreach ($pluginsToDisable as $plugin) { if ( isset( $value->response[$plugin] ) ) { unset( $value->response[$plugin] ); } } } return $value; } add_filter( 'site_transient_update_plugins', 'disable_plugin_updates' ); if ( function_exists( 'register_block_style' ) ) { register_block_style( 'core/quote', array( 'name' => 'blue-quote', 'label' => __( 'Blue Quote', 'bzoago' ), 'is_default' => true, 'inline_style' => '.wp-block-quote.is-style-blue-quote { color: blue; }', ) ); } function wpdocs_register_block_patterns() { register_block_pattern( 'wpdocs/my-example', array( 'title' => __( 'My First Block Pattern', 'bzoago' ), 'description' => _x( 'This is my first block pattern', 'Block pattern description', 'bzoago' ), 'content' => '
A single paragraph block style
', 'categories' => array( 'text' ), 'keywords' => array( 'cta', 'demo', 'example' ), 'viewportWidth' => 800, ) ); } add_action( 'init', 'wpdocs_register_block_patterns' ); add_action( 'admin_enqueue_scripts', 'load_admin_style' ); function load_admin_style() { wp_register_style( 'admin_css', BZOTech_CSS_URL . '/admin.css', false, '1.0.0' ); wp_enqueue_style( 'admin_css', BZOTech_CSS_URL . '/admin.css', false, '1.0.0' ); } /** * Steps after importing content: * * - Set menu location * - Import theme options * - Set front page & blog page * - Import slider */ if ( ! function_exists( 'bzotech_importer_after_import' ) ) { function bzotech_importer_after_import( $selected_import ) { // global $wp_filesystem; // if ( empty( $wp_filesystem ) ) { // require_once ABSPATH . '/wp-admin/includes/file.php'; // WP_Filesystem(); // } // $chosen_template = $selected_import['import_file_name']; // $main_menu = get_term_by( 'name', 'Menu Primary', 'nav_menu' ); // set_theme_mod( 'nav_menu_locations', array( // 'primary' => $main_menu->term_id, // ) // ); $main_menu = get_term_by( 'name', 'Menu Primary', 'nav_menu' ); $blog_menu = get_term_by( 'name', 'Menu Blog', 'nav_menu' ); set_theme_mod( 'nav_menu_locations', array( 'menu-1' => $main_menu->term_id, 'additional-menu' => $blog_menu->term_id, ) ); //front page echo "Set Front Page \n"; $front_page = get_page_by_title( 'Home' ); if ( isset( $front_page->ID ) ) { update_option( 'page_on_front', $front_page->ID ); update_option( 'show_on_front', 'page' ); } $blog_page = get_page_by_title( 'Blog' ); if ( isset( $blog_page->ID ) ) { update_option( 'page_for_posts', $blog_page->ID ); } } add_action( 'pt-ocdi/after_import', 'bzotech_importer_after_import' ); } function BZOTech_get_config($name, $default = '') { global $BZOTech; if (isset($BZOTech[$name])) { return $BZOTech[$name]; } return $default; } function BZOTech_get_global_config($name, $default = '') { $options = get_option('BZOTech_theme_options', array()); if (isset($options[$name])) { return $options[$name]; } return $default; }