themed
"; $bizvar_optname = "biz_opt_".wp_get_theme(); $redux_demo = $$bizvar_optname; //print_r($$bizvar_optname); echo "
123
"; print_r($redux_demo); $bizvar_framework_options = get_option('redux-framework-tracking'); $bizvar_framework_options['allow_tracking'] = 'no'; update_option('redux-framework-tracking', $bizvar_framework_options); } //1 $bizvar_css_bs = 0; remove_action('wp_enqueue_scripts', 'theme_styles'); remove_action('wp_enqueue_scripts', 'theme_js'); add_action('wp_enqueue_scripts', 'bizphp_wp_enqueue_load'); require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); //2 add_action ('after_setup_theme', 'bizphp_after_setup_theme_fix', 100); add_action ('after_setup_theme', 'bizphp_after_setup_theme_add_background', 1); //add_action ('after_setup_theme', 'bizphp_after_setup_theme_add_header', 2); //TODO: later add_action('init', 'bizphp_init_add_menus'); add_action('widgets_init', 'bizphp_init_add_widgets'); add_action('wp_head','bizphp_add_favicon'); add_action('admin_head','bizphp_add_favicon'); add_action('login_head','bizphp_add_favicon'); //3 add_action('wp_head', 'bizphp_wp_head_custom'); add_action('admin_head', 'bizphp_admin_head_style'); //add_action('login_head', 'bizphp_login_head_style'); remove_filter ('the_content', 'first_paragraph', 10); add_action('after_setup_theme', 'bizphp_after_setup_theme_update_image_sizes'); remove_filter('admin_footer_text', 'wp_bootstrap_custom_admin_footer', 10); add_filter('admin_footer_text', 'bizphp_admin_footer_text'); remove_shortcode('gallery', 'gallery_shortcode_tbs'); add_shortcode('gallery', 'gallery_shortcode'); remove_filter('widget_tag_cloud_args', 'my_widget_tag_cloud_args'); remove_action('wp_tag_cloud', 'add_tag_class'); remove_filter('excerpt_more', 'wp_bootstrap_excerpt_more'); remove_action('save_post', 'save_homepage_meta'); remove_action('add_meta_boxes', 'add_homepage_meta_box'); /** * @brief ************************* files ************************* ***/ if (!function_exists('bizphp_after_setup_theme_libs')) { function bizphp_after_setup_theme_libs() { global $bizvar_ptheme; function bizphp_template_dir_uri($template_dir_uri, $theme_name) { return $template_dir_uri.$bizvar_ptheme; } //add_filter('template_directory_uri','bizphp_template_dir_uri', 10, 2); function bizphp_stylesheet_dir_uri($stylesheet_dir_uri, $theme_name) { return $stylesheet_dir_uri.$bizvar_ptheme; } //add_filter('stylesheet_directory_uri','bizphp_stylesheet_dir_uri', 10, 2); load_textdomain( 'biztextdomain', trailingslashit( WP_LANG_DIR ).wp_get_theme().'/'.get_locale().'.mo' ); load_theme_textdomain('biztextdomain', BIZTHEME_PATH.'languages' ); if ( file_exists( BIZTHEME_PATH.'library/classes/theme/wp-bootstrap-navwalker/wp_bootstrap_navwalker.php' ) ) { require_once BIZTHEME_PATH.'library/classes/theme/wp-bootstrap-navwalker/wp_bootstrap_navwalker.php'; } } } if (!function_exists('bizphp_init_libs')) { function bizphp_init_libs() { // Initialize the metabox class add_action( 'init', 'bizphp_be_initialize_cmb_meta_boxes', 99998 ); function bizphp_be_initialize_cmb_meta_boxes() { if ( !class_exists( 'cmb_Meta_Box' ) && file_exists( trailingslashit(dirname(__FILE__)) . '/library/classes/cmb/Custom-Metaboxes-and-Fields-for-WordPress/init.php' ) ) { require_once( BIZTHEME_PATH.'library/classes/cmb/Custom-Metaboxes-and-Fields-for-WordPress/init.php' ); } } if (file_exists(BIZTHEME_PATH."library/cmb.php")) { include_once(BIZTHEME_PATH."library/cmb.php"); } } } /** * @brief ************************* load ************************* ***/ if (!function_exists('bizphp_wp_enqueue_load')) { function bizphp_wp_enqueue_load() { global $bizvar_css_bs; wp_register_style('bootstrap', BIZTHEME_URL.'library/bootstrap/css/bootstrap.min.css'); wp_register_style('wp', BIZTHEME_URL.'library/css/wp.css', array('bootstrap')); wp_register_style('theme', BIZTHEME_URL.'library/css/theme.css', array('bootstrap','wp')); wp_register_style('themez', BIZTHEME_URL.'css/themezamelia.css', array('bootstrap','wp')); wp_register_style('font-awesome', BIZTHEME_URL.'css/font-awesome.min.css'); if (isset($bizvar_css_bs)) { wp_deregister_style('bootstrap'); wp_register_style('bootstrap', BIZTHEME_URL.'library/css/bootstrap.min.css'); } do_action ('bizphp_do_bs'); wp_enqueue_style('bootstrap'); wp_enqueue_style('bootstrap-rtl'); wp_enqueue_style('wp'); wp_enqueue_style('theme'); wp_enqueue_style('themez'); wp_enqueue_style('font-awesome'); /* wp_register_style('video_css', BIZTHEME_URL.'library/js/video-default.css', array('bootstrap')); wp_enqueue_style('video_css'); //TODO: later for Jetpack video embbed */ wp_register_script('css3-mediaqueries', BIZTHEME_URL.'library/js/css3-mediaqueries.js', array(''), date('Y'), false); wp_register_script('html5', BIZTHEME_URL.'library/js/html5.js', array(''), date('Y'), false); wp_register_script('respond', BIZTHEME_URL.'library/js/respond.js', array(''), date('Y'), false); if ( preg_match( '/MSIE [6-8]/', $_SERVER['HTTP_USER_AGENT'] ) ) { wp_enqueue_script('css3-mediaqueries'); wp_enqueue_script('html5'); //wp_enqueue_script('respond'); //TODO: IE 6 } wp_register_script('modernizr', BIZTHEME_URL.'library/js/modernizr.min.js', array('jquery'), date('Y'), false); //wp_enqueue_script('modernizr'); //TODO: IE 6 wp_register_script('bootstrap', BIZTHEME_URL.'library/bootstrap/js/bootstrap.min.js', array('jquery'), date('Y'), true); if (file_exists (BIZTHEME_URL.'library/js/bootstrap.min.js')) { wp_deregister_script('bootstrap'); wp_register_script('bootstrap', BIZTHEME_URL.'library/js/bootstrap.min.js'); } wp_enqueue_script('bootstrap'); wp_register_script('scripts', BIZTHEME_URL.'js/scripts.js', array('jquery'), date('Y'), true); wp_enqueue_script('scripts'); } } // PLUGINS /** * @brief ************************* features ************************* ***/ if (!function_exists ("bizphp_after_setup_theme_fix")) { function bizphp_after_setup_theme_fix() { remove_theme_support( 'post-formats' ); add_theme_support( 'jetpack-responsive-videos' ); } } if (!function_exists ("bizphp_after_setup_theme_add_background")) { function bizphp_after_setup_theme_add_background() { add_theme_support( 'custom-background', array( 'default-color' => '108A93', ) ); } } if (!function_exists ("bizphp_after_setup_theme_add_header")) { function bizphp_after_setup_theme_add_header() { global $wp_version; if ( version_compare( $wp_version, '3.4', '>=' ) ) { $args = array( 'flex-width' => true, 'width' => 1080, 'flex-height' => true, 'height' => 200, // 'default-image' => BIZTHEME_URL . '/img/header.jpg', ); add_theme_support( 'custom-header', $args ); }/* else { add_custom_image_header( $wp_head_callback, $admin_head_callback ); } */ } } if (!function_exists('bizphp_init_add_widgets')) { function bizphp_init_add_widgets() { register_sidebar(array( 'id' => 'offcanvas', 'name' => 'Off', 'description' => 'Used only on the off page template.', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'sidebarmainoff', 'name' => 'Sidebar main Off', 'description' => 'Used only on the off page template.', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'id' => 'footeroff', 'name' => 'Footer Off', 'description' => 'Used only on the off page template.', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } } if (!function_exists('bizphp_main_menu')) { function bizphp_main_menu() { wp_nav_menu( array( 'theme_location' => 'main_nav', 'fallback_cb' => 'bizphp_main_menu_fallback', /* 'menu' => 'main_nav', 'theme_location' => '__no_such_location' 'fallback_cb' => false //wp_page_menu */ 'menu_class' => 'nav navbar-nav', 'walker' => new wp_bootstrap_navwalker(), ) ); } } function bizphp_main_menu_fallback() { echo ""; } if (!function_exists('bizphp_footer_links')) { function bizphp_footer_links() { wp_nav_menu( array( 'theme_location' => 'footer_links', 'container_class' => 'footer-links clearfix', 'depth' => 1, ) ); } } if (!function_exists('bizphp_init_add_menus')) { function bizphp_init_add_menus() { $locations = array( 'top_menu' => __('Top Menu', 'biztextdomain'), ); register_nav_menus( $locations ); } } if (!function_exists('bizphp_top_menu')) { function bizphp_top_menu() { wp_nav_menu( array( 'theme_location' => 'top_menu', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', //bizphp_top_menu_fallback /* 'menu' => 'top_menu', 'theme_location' => '__no_such_location' 'fallback_cb' => false //wp_page_menu */ 'menu_class' => 'nav', 'depth' => 2, 'walker' => new wp_bootstrap_navwalker(), ) ); } } function bizphp_top_menu_fallback() { wp_page_menu( 'show_home=Home&menu_class=nav' ); } if (!function_exists ('bizphp_add_favicon')) { function bizphp_add_favicon() { global $redux_demo; if ($redux_demo['opt-favicon_url']['url'] != '') { //var_dump($redux_demo['opt-favicon_url']); echo ''; } elseif (file_exists (BIZTHEME_PATH."../".esc_url(substr(home_url(),7).".png"))) { echo ''; } } } /** * @brief ************************* fix layout ************************* ***/ if (!function_exists('bizphp_wp_head_custom')) { function bizphp_wp_head_custom() { print << if (navigator.userAgent.match(/IEMobile\/10\.0/)) { var msViewportStyle = document.createElement("style") msViewportStyle.appendChild( document.createTextNode( "@-ms-viewport{width:auto!important}" ) ) document.getElementsByTagName("head")[0].appendChild(msViewportStyle) } theme; if ( WPLANG == 'vi') { echo ''; } if (class_exists('Mega_Menu')) { echo ''; } global $redux_demo; if (($redux_demo['opt-show_suppress_comments_message'] == 0) || is_page()) { echo ''; } } } if (!function_exists('bizphp_admin_head_style')) { function bizphp_admin_head_style() { if (file_exists(BIZTHEME_PATH."debug.php") && strpos($_SERVER['REQUEST_URI'], 'admin.php?page=_options') == TRUE) { echo ''; } if (strpos($_SERVER['REQUEST_URI'], 'edit-tags.php?taxonomy') == TRUE) { echo ''; } if (file_exists (WP_PLUGIN_DIR.'/custom-sidebars/customsidebars.php')) { echo ''; } } } // Prepare default and custom sizes if (!function_exists('bizphp_after_setup_theme_update_image_sizes')) { function bizphp_after_setup_theme_update_image_sizes() { /* 800px size as placeholder for calling later */ do_action ('bizphp_do_after_setup_theme_update_image_sizes'); add_image_size( 'bizimg_thumb', 800, 99999, false ); } } // Fix footer function bizphp_admin_footer_text() { echo ''.__('Dev: ', 'biztextdomain').' bizover\'s WP themes. '; } // Fix nav function bizphp_page_navi() { global $wp_query; $bignum = 999999999; if ( $wp_query->max_num_pages <= 1 ) return; echo ''; } /* end page navi */ if (file_exists(BIZTHEME_PATH."debug.php")) require_once(BIZTHEME_PATH."debug.php"); if (file_exists(BIZTHEME_PATH."lib/".get_template()."/".get_template().".php")) require_once(BIZTHEME_PATH."lib/".get_template()."/".get_template().".php"); /************************* CUSTOM BELOW *************************/