get('Version')); } define('BLOCKPAGE_DEBUG', defined('WP_DEBUG') && WP_DEBUG === true); define('BLOCKPAGE_DIR', trailingslashit(get_template_directory())); define('BLOCKPAGE_URL', trailingslashit(get_template_directory_uri())); if (!function_exists('blockpage_support')) : /** * Sets up theme defaults and registers support for various WordPress features. * * @since walker_fse 1.0.0 * * @return void */ function blockpage_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'); } endif; add_action('after_setup_theme', 'blockpage_support'); /*---------------------------------------------------------------------------------- Enqueue Styles -----------------------------------------------------------------------------------*/ if (!function_exists('blockpage_styles')) : function blockpage_styles() { // registering style for theme wp_enqueue_style('blockpage-style', get_stylesheet_uri(), array(), BLOCKPAGE_VERSION); wp_enqueue_style('blockpage-blocks-style', get_template_directory_uri() . '/assets/css/blocks.css'); if (is_rtl()) { wp_enqueue_style('rtl-css', get_template_directory_uri() . '/assets/css/rtl.css', 'rtl_css'); } wp_enqueue_script('blockpage-scripts', get_template_directory_uri() . '/assets/js/blockpage-scripts.js', array('jquery'), BLOCKPAGE_VERSION, true); } endif; add_action('wp_enqueue_scripts', 'blockpage_styles'); /** * Enqueue scripts for admin area */ function blockpage_admin_style() { $hello_notice_current_screen = get_current_screen(); if (!empty($_GET['page']) && 'about-blockpage' === $_GET['page'] || $hello_notice_current_screen->id === 'themes') { wp_enqueue_style('blockpage-admin-style', get_template_directory_uri() . '/assets/css/admin-style.css', array(), BLOCKPAGE_VERSION, 'all'); } } add_action('admin_enqueue_scripts', 'blockpage_admin_style'); /** * Enqueue assets scripts for both backend and frontend */ function blockpage_block_assets() { wp_enqueue_style('blockpage-blocks-style', get_template_directory_uri() . '/assets/css/blocks.css'); } add_action('enqueue_block_assets', 'blockpage_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('blockpage_excerpt_more_postfix')) { function blockpage_excerpt_more_postfix($more) { if (is_admin()) { return $more; } return '...'; } add_filter('excerpt_more', 'blockpage_excerpt_more_postfix'); } if (!function_exists('blockpage_excerpt_limit')) { function blockpage_excerpt_limit($length) { if (is_admin()) { return $length; } return 29; } add_filter('excerpt_length', 'blockpage_excerpt_limit'); } function blockpage_add_woocommerce_support() { add_theme_support('woocommerce'); } add_action('after_setup_theme', 'blockpage_add_woocommerce_support');