get('Version')); } define('BLOGHOOT_DEBUG', defined('WP_DEBUG') && WP_DEBUG === true); define('BLOGHOOT_DIR', trailingslashit(get_template_directory())); define('BLOGHOOT_URL', trailingslashit(get_template_directory_uri())); if (!function_exists('bloghoot_support')) : /** * Sets up theme defaults and registers support for various WordPress features. * * @since walker_fse 1.0.0 * * @return void */ function bloghoot_support() { // Add default posts and comments RSS feed links to head. add_theme_support('automatic-feed-links'); // Add support for block styles. add_theme_support('wp-block-styles'); add_theme_support('post-thumbnails'); // Enqueue editor styles. add_editor_style('style.css'); // Removing default patterns. remove_theme_support('core-block-patterns'); } endif; add_action('after_setup_theme', 'bloghoot_support'); /*---------------------------------------------------------------------------------- Enqueue Styles -----------------------------------------------------------------------------------*/ if (!function_exists('bloghoot_styles')) : function bloghoot_styles() { // registering style for theme wp_enqueue_style('bloghoot-style', get_stylesheet_uri(), array(), BLOGHOOT_VERSION); if (is_rtl()) { wp_enqueue_style('bloghoot-rtl-css', get_template_directory_uri() . '/assets/css/rtl.css', 'rtl_css'); } // registering js for theme wp_enqueue_script('jquery'); } endif; add_action('wp_enqueue_scripts', 'bloghoot_styles'); /** * Enqueue scripts for admin area */ function bloghoot_admin_style() { if (!is_user_logged_in()) { return; } $bloghoot_notice_current_screen = get_current_screen(); if (!empty($_GET['page']) && 'about-bloghoot' === $_GET['page'] || $bloghoot_notice_current_screen->id === 'themes' || $bloghoot_notice_current_screen->id === 'dashboard') { wp_enqueue_style('bloghoot-admin-style', get_template_directory_uri() . '/assets/css/admin-style.css', array(), BLOGHOOT_VERSION, 'all'); wp_enqueue_script('bloghoot-admin-scripts', get_template_directory_uri() . '/assets/js/bloghoot-admin-scripts.js', array(), BLOGHOOT_VERSION, true); wp_localize_script('bloghoot-admin-scripts', 'bloghoot_localize', array( 'ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('bloghoot_nonce'), 'redirect_url' => admin_url('themes.php?page=templategalaxy') )); } } add_action('admin_enqueue_scripts', 'bloghoot_admin_style'); /** * Enqueue assets scripts for both backend and frontend */ function bloghoot_block_assets() { wp_enqueue_style('bloghoot-blocks-style', get_template_directory_uri() . '/assets/css/blocks.css'); } add_action('enqueue_block_assets', 'bloghoot_block_assets'); /** * Load core file. */ require_once get_template_directory() . '/inc/core/init.php'; /** * Load welcome page file. */ require_once get_template_directory() . '/inc/admin/welcome-notice.php'; if (!function_exists('bloghoot_excerpt_more_postfix')) { function bloghoot_excerpt_more_postfix($more) { if (is_admin()) { return $more; } return '...'; } add_filter('excerpt_more', 'bloghoot_excerpt_more_postfix'); } function bloghoot_add_woocommerce_support() { add_theme_support('woocommerce'); } add_action('after_setup_theme', 'bloghoot_add_woocommerce_support');