get('Version'));
/**
* Add theme support for block styles and editor style.
*
* @since 1.0.0
*
* @return void
*/
function business_directory_bikit_setup()
{
add_editor_style('./assets/css/style-shared.min.css');
/*
* Load additional block styles.
* See details on how to add more styles in the readme.txt.
*/
$styled_blocks = ['button', 'quote', 'navigation', 'search'];
foreach ($styled_blocks as $block_name) {
$args = array(
'handle' => "business_directory_bikit-$block_name",
'src' => get_theme_file_uri("assets/css/blocks/$block_name.min.css"),
'path' => get_theme_file_path("assets/css/blocks/$block_name.min.css"),
);
// Replace the "core" prefix if you are styling blocks from plugins.
wp_enqueue_block_style("core/$block_name", $args);
}
load_theme_textdomain('business_directory_bikit', get_template_directory() . '/languages');
// Add support for WooCommerce
add_theme_support('woocommerce');
add_theme_support('wc-product-gallery-zoom');
//add_theme_support('wc-product-gallery-lightbox');
//add_theme_support('wc-product-gallery-slider');
remove_theme_support('wc-product-gallery-zoom');
// custom logo
add_theme_support('custom-logo');
// Add theme support for selective refresh for widgets.
add_theme_support('customize-selective-refresh-widgets');
add_theme_support("wp-block-styles");
add_theme_support("responsive-embeds");
add_theme_support('custom-header');
add_theme_support("custom-background");
add_theme_support("align-wide");
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support('html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
));
// Add default posts and comments RSS feed links to head.
add_theme_support('automatic-feed-links');
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded
tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support('title-tag');
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support('post-thumbnails');
// This theme uses wp_nav_menu() in one location.
register_nav_menus(array(
'main_menu' => esc_html__('Primary Menu', 'business-directory-bikit'),
'footer_links' => esc_html__('Footer Links', 'business-directory-bikit'),
'mobile_menu' => esc_html__('Mobile Menu', 'business-directory-bikit'),
));
}
add_action('after_setup_theme', 'business_directory_bikit_setup');
/**
* Enqueue the CSS files.
*
* @since 1.0.0
*
* @return void
*/
function business_directory_bikit_styles()
{
wp_enqueue_style(
'business_directory_bikit-style',
get_stylesheet_uri(),
[],
BUSINESS_DIRECTORY_BIKIT
);
wp_enqueue_style(
'business_directory_bikit-shared-styles',
get_theme_file_uri('assets/css/style-shared.min.css'),
[],
BUSINESS_DIRECTORY_BIKIT
);
$remote_url = 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono: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&family=Space+Grotesk:wght@300..700&family=Dm Sans:wght@300;400;500;600;700&display=swap';
if (function_exists('wptt_get_webfont_url')) {
wp_enqueue_style('google-fonts', wptt_get_webfont_url($remote_url), false);
}
wp_enqueue_style(
'bootstrap-grid-5',
get_theme_file_uri('assets/libs/bootstrap-5.3.3/css/bootstrap-grid.min.css'),
[],
'5.3.3'
);
wp_enqueue_script('bootstrap-5', get_theme_file_uri('assets/libs/bootstrap-5.3.3/js/bootstrap.min.js'), ['jquery'], '5.3.3', true);
wp_enqueue_style(
'fontawesome-6.5',
get_theme_file_uri('assets/libs/fontawesome-6.7/css/all.min.css'),
[],
'6.7'
);
wp_enqueue_style(
'business_directory_bikit',
get_theme_file_uri('assets/css/theme.css'),
[],
BUSINESS_DIRECTORY_BIKIT
);
wp_enqueue_style(
'business_directory_bikit-responsive',
get_theme_file_uri('assets/css/theme-responsive.css'),
[],
BUSINESS_DIRECTORY_BIKIT
);
wp_enqueue_script('business_directory_bikit', get_theme_file_uri('assets/js/theme.js'), ['jquery'], BUSINESS_DIRECTORY_BIKIT, true);
}
add_action('wp_enqueue_scripts', 'business_directory_bikit_styles');
function wdk_allow_svg_upload($mimes) {
$mimes['svg'] = 'image/svg+xml';
return $mimes;
}
// Filters.
require_once get_theme_file_path('inc/filters.php');
// Block variation example.
require_once get_theme_file_path('inc/register-block-variations.php');
// Block style examples.
require_once get_theme_file_path('inc/register-block-styles.php');
// Block pattern and block category examples.
require_once get_theme_file_path('inc/register-block-patterns.php');
require_once get_theme_file_path('includes/welcome.php');
require_once get_theme_file_path('includes/init.php');
// Font upload
require_once get_theme_file_path('includes/wptt-webfont-loader.php');
/**
* Admin styles.
*
*/
add_action('admin_head', function () {
echo '';
});
add_filter('intermediate_image_sizes_advanced', function ($sizes) {
if(get_option('apartment_install_ocdi_images_sizes_enable') == 1) {
unset($sizes['thumb']);
unset($sizes['thumbnail']);
unset($sizes['medium']);
unset($sizes['large']);
unset($sizes['medium_large']);
unset($sizes['big_image_size_threshold']);
unset($sizes['post-thumbnail']);
unset($sizes['1536x1536']);
unset($sizes['nexproperty-footer-thumbnail']);
unset($sizes['nexproperty-slider-thumbnail']);
unset($sizes['nexproperty-post-thumbnail']);
unset($sizes['woocommerce_thumbnail']);
unset($sizes['woocommerce_single']);
unset($sizes['woocommerce_gallery_thumbnail']);
unset($sizes['shop_single']);
unset($sizes['shop_thumbnail']);
}
return $sizes;
});
if (get_option('wdk_theme_bikit_installed') == 1) {
add_filter( 'template_include', function ( $template ) {
// Check if the template is in the /templates/ directory and is an HTML file
$html_templates_dir = get_template_directory() . '/templates/';
if ( strpos( $template, 'template-canvas.php' ) ) {
return get_template_directory() . '/html-template-wrapper.php';
}
if ( strpos( $template, $html_templates_dir ) === 0 && pathinfo( $template, PATHINFO_EXTENSION ) === 'html' ) {
return get_template_directory() . '/html-template-wrapper.php';
}
return $template;
} );
add_action('wp_head', function() {
echo '';
});
}
add_action('wp_footer', function() {
?>
ID;
// Replace with your real Elementor blog page ID
$blog_page_url = get_permalink($blog_page_id);
// ---- Tag links ----
add_filter('tag_link', function ($url, $tag_id) use ($blog_page_url) {
$tag = get_tag($tag_id);
if (!$tag) return $url;
return add_query_arg('tag', $tag->slug, $blog_page_url);
}, 10, 2);
// ---- Category links ----
add_filter('category_link', function ($url, $term_id) use ($blog_page_url) {
$cat = get_category($term_id);
if (!$cat) return $url;
return add_query_arg('category_name', $cat->slug, $blog_page_url);
}, 10, 2);
}
});
add_action('template_redirect', function() {
if (is_search() && function_exists('wdk_page_by_title')) {
$page_id = wdk_page_by_title( 'Blog Grid' );
if (!$page_id) return;
$blog_page_id = $page_id->ID;
$elementor_instance = \Elementor\Plugin::instance();
get_header();
echo $elementor_instance->frontend->get_builder_content_for_display($blog_page_id);
get_footer();
exit;
}
});