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'); add_image_size('arther-large', 1170, 606, true); add_image_size('arther-medium', 800, 600, true); // This theme uses wp_nav_menu() in one location. register_nav_menus( array( 'menu-1' => esc_html__('Primary Menu', 'arther'), 'top-menu' => esc_html__('Top Menu', 'arther'), 'social-menu' => esc_html__('Social Menu', 'arther'), ) ); /* * 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', 'style', 'script', ) ); // Set up the WordPress core custom background feature. add_theme_support( 'custom-background', apply_filters( 'arther_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => '', ) ) ); // Add theme support for selective refresh for widgets. add_theme_support('customize-selective-refresh-widgets'); // Add support for responsive embedded content. add_theme_support('responsive-embeds'); // Add support for default block styles. add_theme_support('wp-block-styles'); /* * Add support custom font sizes. * * Add the line below to disable the custom color picker in the editor. * add_theme_support( 'disable-custom-font-sizes' ); */ add_theme_support( 'editor-font-sizes', array( array( 'name' => __('Small', 'arther'), 'shortName' => __('S', 'arther'), 'size' => 16, 'slug' => 'small', ), array( 'name' => __('Medium', 'arther'), 'shortName' => __('M', 'arther'), 'size' => 20, 'slug' => 'medium', ), array( 'name' => __('Large', 'arther'), 'shortName' => __('L', 'arther'), 'size' => 25, 'slug' => 'large', ), array( 'name' => __('Larger', 'arther'), 'shortName' => __('XL', 'arther'), 'size' => 35, 'slug' => 'larger', ), ) ); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'height' => 250, 'width' => 250, 'flex-width' => true, 'flex-height' => true, ) ); add_theme_support('woocommerce'); add_theme_support('wc-product-gallery-zoom'); add_theme_support('wc-product-gallery-slider'); // Add support for Yoast SEO Breadcrumbs. add_theme_support('yoast-seo-breadcrumbs'); // Add support for Rank Math Breadcrumbs. add_theme_support('rank-math-breadcrumbs'); } endif; add_action('after_setup_theme', 'arther_setup'); /** * Set the content width in pixels, based on the theme's design and stylesheet. * * Priority 0 to make it available to lower priority callbacks. * * @global int $content_width */ function arther_content_width() { $GLOBALS['content_width'] = apply_filters('arther_content_width', 640); } add_action('after_setup_theme', 'arther_content_width', 0); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function arther_widgets_init() { register_sidebar( array( 'name' => esc_html__('Sidebar', 'arther'), 'id' => 'sidebar-1', 'description' => esc_html__('Add widgets here.', 'arther'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__('Shop Sidebar', 'arther'), 'id' => 'sidebar-shop', 'description' => esc_html__('Add widgets here.', 'arther'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__('Footer 1', 'arther'), 'id' => 'footer-1', 'description' => esc_html__('Add widgets here.', 'arther'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__('Footer 2', 'arther'), 'id' => 'footer-2', 'description' => esc_html__('Add widgets here.', 'arther'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => esc_html__('Footer 3', 'arther'), 'id' => 'footer-3', 'description' => esc_html__('Add widgets here.', 'arther'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action('widgets_init', 'arther_widgets_init'); /** * Load Font Family. */ if (!function_exists('arther_fonts_url')) { /** * Register custom fonts. * Credits: * Twenty Seventeen WordPress Theme, Copyright 2016 WordPress.org * Twenty Seventeen is distributed under the terms of the GNU GPL */ function arther_fonts_url() { $fonts_url = ''; $font_families = array(); global $arther_theme_options; $arther_theme_options = arther_get_options_value(); $font_families[] = $arther_theme_options['arther-font-family-url']; $font_families[] = $arther_theme_options['arther-font-heading-family-url']; $font_families = array_unique($font_families); $query_args = array( 'family' => rawurlencode(implode('|', $font_families)), 'subset' => rawurlencode('latin,latin-ext'), ); $fonts_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css'); return esc_url_raw($fonts_url); } } /** * Add preconnect for Google Fonts. * * @param array $urls URLs to print for resource hints. * @param string $relation_type The relation type the URLs are printed. * @return array $urls URLs to print for resource hints. */ function arther_resource_hints($urls, $relation_type) { if (wp_style_is('arther-fonts', 'queue') && 'preconnect' === $relation_type) { $urls[] = array( 'href' => 'https://fonts.gstatic.com', 'crossorigin', ); } return $urls; } add_filter('wp_resource_hints', 'arther_resource_hints', 10, 2); /** * Enqueue scripts and styles. */ function arther_scripts() { /*google font */ global $arther_theme_options; $arther_google_fonts_name = arther_google_fonts(); $arther_body_fonts = ''; $arther_heading_fonts = ''; if (!empty($arther_theme_options['arther-font-family-url'])) { $arther_body_fonts = esc_attr($arther_theme_options['arther-font-family-url']); } if (!empty($arther_theme_options['arther-font-heading-family-url'])) { $arther_heading_fonts = esc_attr($arther_theme_options['arther-font-heading-family-url']); } $arther_google_fonts_enqueue = array( $arther_body_fonts, $arther_heading_fonts, ); $arther_google_fonts_enqueue_uniques = array_unique($arther_google_fonts_enqueue); foreach ($arther_google_fonts_enqueue_uniques as $arther_google_fonts_enqueue_unique) { wp_enqueue_style( $arther_google_fonts_enqueue_unique, '//fonts.googleapis.com/css?family=' . $arther_google_fonts_enqueue_unique . '', array(), '' ); } $arther_fontawesome = !empty($arther_theme_options['arther-font-awesome-version-loading']) ? esc_attr($arther_theme_options['arther-font-awesome-version-loading']) : 'version-6'; if ($arther_fontawesome == 'version-4') { /*Font-Awesome-master*/ wp_enqueue_style('font-awesome-4', get_template_directory_uri() . '/candidthemes/assets/framework/Font-Awesome/css/font-awesome.min.css', array(), _S_VERSION); } else { wp_enqueue_style('font-awesome-6', get_template_directory_uri() . '/candidthemes/assets/framework/font-awesome-6/css/all.min.css', array(), _S_VERSION); /*Font-Awesome-master*/ } wp_enqueue_style('slick', get_template_directory_uri() . '/candidthemes/assets/framework/slick/slick.css', array(), _S_VERSION); wp_enqueue_style('slick-theme', get_template_directory_uri() . '/candidthemes/assets/framework/slick/slick-theme.css', array(), _S_VERSION); wp_enqueue_style('arther-style', get_stylesheet_uri(), array(), _S_VERSION); wp_style_add_data('arther-style', 'rtl', 'replace'); wp_enqueue_script('arther-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true); if (!empty($arther_theme_options['arther-enable-sticky-sidebar']) && 1 == absint($arther_theme_options['arther-enable-sticky-sidebar'])) { wp_enqueue_script('theia-sticky-sidebar', get_template_directory_uri() . '/candidthemes/assets/custom/js/theia-sticky-sidebar.js', array('jquery'), _S_VERSION, true); } wp_enqueue_script('slick', get_template_directory_uri() . '/candidthemes/assets/framework/slick/slick.js', array('jquery'), _S_VERSION, true); wp_enqueue_script('masonry'); wp_enqueue_script('arther-custom-js', get_template_directory_uri() . '/candidthemes/assets/custom/js/custom.js', array('jquery'), _S_VERSION, true); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } if (!empty($arther_theme_options['arther-pagination-options'])) { $arther_pagination_option = $arther_theme_options['arther-pagination-options']; if ($arther_pagination_option == 'ajax') { wp_enqueue_script('arther-custom-pagination', get_template_directory_uri() . '/candidthemes/assets/custom/js/custom-infinte-pagination.js', array('jquery'), _S_VERSION, true); global $wp_query; $paged = (get_query_var('paged') > 1) ? get_query_var('paged') : 1; $max_num_pages = $wp_query->max_num_pages; wp_localize_script('arther-custom-pagination', 'arther_ajax', array( 'ajaxurl' => esc_url(admin_url('admin-ajax.php')), 'paged' => absint($paged), 'max_num_pages' => absint($max_num_pages), 'next_posts' => next_posts(absint($max_num_pages), false), 'show_more' => __('Load More', 'arther'), 'no_more_posts' => __('No More', 'arther'), 'pagination_option' => $arther_pagination_option )); } } } add_action('wp_enqueue_scripts', 'arther_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'; /** * Functions which enhance the theme by hooking into WordPress. */ require get_template_directory() . '/inc/template-functions.php'; /** * Customizer additions. */ require get_template_directory() . '/inc/customizer.php'; /** * Load Jetpack compatibility file. */ if (defined('JETPACK__VERSION')) { require get_template_directory() . '/inc/jetpack.php'; } /** * Load Core File */ require get_template_directory() . '/candidthemes/core.php'; /** * Load breadcrumb_trail File */ if (!function_exists('breadcrumb_trail')) { require get_template_directory() . '/candidthemes/assets/framework/breadcrumbs/breadcrumbs.php'; } /** * For Admin Page */ if (is_admin()) { require get_template_directory() . '/candidthemes/notice/admin-notice.php'; require get_template_directory() . '/candidthemes/about/about.php'; }