'17754', 'slug' => 'brighter-blog', 'type' => 'theme', 'public_key' => 'pk_4e478b13e59b9580658e77a2b51be', 'is_premium' => false, 'has_addons' => true, 'has_paid_plans' => false, 'menu' => array( 'slug' => 'brighter-blog', 'support' => false, ), ) ); } return $bbe_fs; } // Init Freemius. bbe_fs(); // Signal that SDK was initiated. do_action( 'bbe_fs_loaded' ); } if (!defined('BRIGHTER_BLOG_VERSION')) { $brighter_blog_theme = wp_get_theme(); define('BRIGHTER_BLOG_VERSION', $brighter_blog_theme->get('Version')); } // Inc folder directory define('BRIGHTER_BLOG_INC_DIR', get_template_directory() . '/inc/'); /* * Customizer Pro */ require_once get_template_directory() . '/customize-pro/class-customize.php'; /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which * runs before the init hook. The init hook is too late for some features, such * as indicating support for post thumbnails. */ function brighter_blog_setup() { /* * Make theme available for translation. * Translations can be filed in the /languages/ directory. * If you're building a theme based on Brighter-Blog, use a find and replace * to change 'brighter-blog' to the name of your theme in all the template files. */ load_theme_textdomain('brighter-blog', get_template_directory() . '/languages'); // 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( 'primary-menu' => __('Primary Menu', 'brighter-blog'), // Add more menu locations as needed 'footer' => esc_html__( 'Footer Menu', 'brighter-blog' ), ) ); /* * 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( 'brighter_blog_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 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( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio') ); } add_action('after_setup_theme', 'brighter_blog_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 brighter_blog_content_width() { $GLOBALS['content_width'] = apply_filters('brighter_blog_content_width', 640); } add_action('after_setup_theme', 'brighter_blog_content_width', 0); /** * Register widget area. * * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar */ function brighter_blog_widgets_init() { register_sidebar( array( 'name' => esc_html__('Sidebar', 'brighter-blog'), 'id' => 'sidebar-1', 'description' => esc_html__('Add sidebar widgets here.', 'brighter-blog'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => esc_html__('Latest Post Sidebar', 'brighter-blog'), 'id' => 'latest-sidebar', 'description' => esc_html__('Add sidebar widgets here.', 'brighter-blog'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => esc_html__('In Focus Sidebar', 'brighter-blog'), 'id' => 'in-focus-sidebar', 'description' => esc_html__('Add sidebar widgets here.', 'brighter-blog'), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => esc_html__('Footer One', 'brighter-blog'), 'id' => 'footer-one', 'description' => esc_html__('Add Footer widgets here.', 'brighter-blog'), 'before_widget' => '<div id="%1$s" class="widget footer-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => esc_html__('Footer Two', 'brighter-blog'), 'id' => 'footer-two', 'description' => esc_html__('Add Footer widgets here.', 'brighter-blog'), 'before_widget' => '<div id="%1$s" class="widget footer-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => esc_html__('Footer Three', 'brighter-blog'), 'id' => 'footer-three', 'description' => esc_html__('Add Footer widgets here.', 'brighter-blog'), 'before_widget' => '<div id="%1$s" class="widget footer-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>', ) ); register_sidebar( array( 'name' => esc_html__('Footer Four', 'brighter-blog'), 'id' => 'footer-four', 'description' => esc_html__('Add Footer widgets here.', 'brighter-blog'), 'before_widget' => '<div id="%1$s" class="widget footer-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget_title">', 'after_title' => '</h3>', ) ); } add_action('widgets_init', 'brighter_blog_widgets_init'); /** * Enqueue scripts and styles. */ function brighter_blog_scripts() { // Enqueue Styles wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'bootstrap-rtl-min', get_template_directory_uri() . '/assets/css/bootstrap.rtl.min.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'all-min', get_template_directory_uri() . '/assets/css/fontawesome/css/all.min.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'brands-min', get_template_directory_uri() . '/assets/css/fontawesome/css/brands.min.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'fontawesome-min', get_template_directory_uri() . '/assets/css/fontawesome/css/fontawesome.min.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'magnific-popup-min', get_template_directory_uri() . '/assets/css/magnific-popup.min.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'animate-min-css', get_template_directory_uri() . '/assets/css/animate.min.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'slick-min-css', get_template_directory_uri() . '/assets/css/slick.min.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'metabox-admin-css', get_template_directory_uri() . '/assets/css/metabox-admin.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'brighter-blog-asset-style', get_template_directory_uri() . '/assets/css/style.css', array(), BRIGHTER_BLOG_VERSION ); wp_enqueue_style( 'brighter-blog-style', get_stylesheet_uri(), array(), BRIGHTER_BLOG_VERSION ); wp_style_add_data('brighter-blog-style', 'rtl', 'replace'); // Enqueue Fonts wp_enqueue_style( 'brighter-blog-fonts', brighter_blog_fonts_url(), array(), null ); // Enqueue Scripts if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } wp_enqueue_script( 'all-min-js', get_template_directory_uri() . '/assets/css/fontawesome/js/all.min.js', array("jquery"), BRIGHTER_BLOG_VERSION, true ); wp_enqueue_script( 'slick-min', get_template_directory_uri() . '/assets/js/slick.min.js', array('jquery'), BRIGHTER_BLOG_VERSION, true ); wp_enqueue_script( 'bootstrap-min', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array(), BRIGHTER_BLOG_VERSION, true ); wp_enqueue_script( 'magnific-popup-min', get_template_directory_uri() . '/assets/js/jquery.magnific-popup.min.js', array('jquery'), BRIGHTER_BLOG_VERSION, true ); wp_enqueue_script( 'counterup-min', get_template_directory_uri() . '/assets/js/jquery.counterup.min.js', array('jquery'), BRIGHTER_BLOG_VERSION, true ); wp_enqueue_script( 'jquery-marquee-min', get_template_directory_uri() . '/assets/js/jquery.marquee.min.js', array('jquery'), BRIGHTER_BLOG_VERSION, true ); wp_enqueue_script( 'imagesloaded-pkgd-min', get_template_directory_uri() . '/assets/js/imagesloaded.pkgd.min.js', array('jquery'), BRIGHTER_BLOG_VERSION, true ); wp_enqueue_script( 'isotope-pkgd-min', get_template_directory_uri() . '/assets/js/isotope.pkgd.min.js', array('jquery'), BRIGHTER_BLOG_VERSION, true ); wp_enqueue_script( 'wow-min-js', get_template_directory_uri() . '/assets/js/wow.min.js', array('jquery'), BRIGHTER_BLOG_VERSION, true ); wp_enqueue_script( 'brighter-blog-main', get_template_directory_uri() . '/assets/js/main.js', array('jquery', 'jquery-ui-slider'), BRIGHTER_BLOG_VERSION, true ); } add_action('wp_enqueue_scripts', 'brighter_blog_scripts'); // Function for fonts URL function brighter_blog_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin,latin-ext'; // Load Jost font if ('off' !== _x('on', 'Jost: on or off', 'brighter-blog')) { $fonts[] = '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'; } // Load Outfit font $fonts[] = 'Outfit:wght@100..900'; // Load Hanken Grotesk font $fonts[] = 'Hanken+Grotesk:ital,wght@0,100..900;1,100..900'; // Load Open Sans font $fonts[] = 'Open+Sans:wght@300;400;600;700'; // Load Kumbh Sans font $fonts[] = 'Kumbh+Sans:wght@300;400;500;700'; // Generate font URL if ($fonts) { $fonts_url = add_query_arg(array( 'family' => urlencode(implode('|', $fonts)), 'subset' => urlencode($subsets), ), 'https://fonts.googleapis.com/css'); } return esc_url_raw($fonts_url); } function brighter_blog_scripts_matabox() { wp_enqueue_script('brighter-blog-matabox', get_template_directory_uri() . '/assets/js/metabox.js', array("jquery"), BRIGHTER_BLOG_VERSION, false); } add_action('admin_enqueue_scripts', 'brighter_blog_scripts_matabox'); function brighter_blog_customizer_admin_styles() { wp_enqueue_style('brighter-blog-customizer-styles', get_template_directory_uri() . '/assets/css/admin-customizer.css'); } add_action('admin_enqueue_scripts', 'brighter_blog_customizer_admin_styles'); function brighter_blog_enqueue_admin_custom_script() { // Register the script wp_register_script( 'brighter-blog-admin-category-icon-script', // Handle with prefix get_template_directory_uri() . '/assets/js/admin-category-icon.js', // Script file path array('jquery'), // Dependencies '1.0', // Version true // Load in footer ); // Enqueue the script only on category editing and adding screens $screen = get_current_screen(); if ($screen && in_array($screen->id, array('edit-category', 'term', 'edit-tags', 'add-tags'))) { wp_enqueue_script('brighter-blog-admin-category-icon-script'); } } add_action('admin_enqueue_scripts', 'brighter_blog_enqueue_admin_custom_script'); /** * Implement the Custom Header feature. */ require BRIGHTER_BLOG_INC_DIR . 'custom-header.php'; /** * Implement the Custom Hook feature. */ require BRIGHTER_BLOG_INC_DIR . 'hook/custom-hook.php'; /** * Custom template tags for this theme. */ require BRIGHTER_BLOG_INC_DIR . 'template-tags.php'; /** * Functions which enhance the theme by hooking into WordPress. */ require BRIGHTER_BLOG_INC_DIR . 'template-functions.php'; /** * Customizer additions. */ require BRIGHTER_BLOG_INC_DIR . 'meta-box/brighter-blog-metabox.php'; /** * Customizer additions. */ require BRIGHTER_BLOG_INC_DIR . 'customizer.php'; /** * Kirki Customizer additions. */ if (class_exists('Kirki')) { require BRIGHTER_BLOG_INC_DIR . 'kirki-customizer.php'; } /** * TGM. */ require_once BRIGHTER_BLOG_INC_DIR . 'recommendation-plugin.php'; /** * Load Jetpack compatibility file. */ if (defined('JETPACK__VERSION')) { require BRIGHTER_BLOG_INC_DIR . 'jetpack.php'; } /** * Load WooCommerce compatibility file. */ if (class_exists('WooCommerce')) { require BRIGHTER_BLOG_INC_DIR . 'woocommerce.php'; } /** * Custom widgets */ require BRIGHTER_BLOG_INC_DIR . 'widget/widgets-init.php'; /** * kirki partial refresh */ require BRIGHTER_BLOG_INC_DIR . 'kirki-render-callback.php'; function brighter_blog_register_block_styles() { // Register a new style for the core/quote block register_block_style( // phpcs:ignore WPThemeReview.PluginTerritory.ForbiddenFunctions.editor_blocks_register_block_style 'core/quote', array( 'name' => 'fancy-quote', 'label' => __('Fancy Quote', 'brighter-blog'), ) ); // Register more block styles here as needed } add_action('init', 'brighter_blog_register_block_styles'); add_theme_support( "wp-block-styles" ); // Add support for responsive embeds add_theme_support('responsive-embeds'); // Add support for wide alignment add_theme_support('align-wide'); // Enqueue editor styles function brighter_blog_editor_styles() { add_editor_style('asset/css/gutenberg.css'); // Replace 'editor-style.css' with the path to your editor stylesheet } add_action('admin_init', 'brighter_blog_editor_styles');