/** * Sets up theme defaults and registers support for various WordPress features. * * @package blippi */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } function blippi_setup() { // Load theme textdomain. load_theme_textdomain( 'blippi', 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 WooCommerce Support add_theme_support( 'woocommerce' ); /* * 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' => esc_html__( 'Primary', 'blippi' ), 'footer-menu' => esc_html__( 'Footer Menu', 'blippi' ), ) ); /* * 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( 'blippi_custom_background_args', array( 'default-color' => 'ffffff' ) ) ); // 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' => 80, 'width' => 360, 'flex-width' => true, 'flex-height' => true, ) ); // Remove widgets block editor support remove_theme_support( 'widgets-block-editor' ); // Image Sizes add_image_size( 'blippi-thumb-classic', 770, 350, true ); add_image_size( 'blippi-thumb-grid', 380, 250, true ); add_image_size( 'blippi-project-350x400', 350, 400, true ); } add_action( 'after_setup_theme', 'blippi_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 blippi_content_width() { $GLOBALS['content_width'] = apply_filters( 'blippi_content_width', 640 ); } add_action( 'after_setup_theme', 'blippi_content_width', 0 ); /** * Get theme options * * @param string $option Option name. * @param mixed $default Default value. * @return mixed */ if ( ! function_exists( 'blippi_get_option' ) ) { function blippi_get_option( $option = '', $default = null ) { $options = get_option( 'blippi_opt' ); return ( isset( $options[$option] ) ) ? $options[$option] : $default; } } /** * Helper */ require get_template_directory() . '/inc/helper.php'; /** * Sidebar check */ require get_template_directory() . '/inc/sidebar-check.php'; /** * TGM Plugin Activation */ require get_template_directory() . '/inc/tgm/init.php'; /** * Enqueue scripts and styles */ require get_template_directory() . '/inc/assets.php'; /** * Theme Options */ add_action( 'after_setup_theme', function() { require get_template_directory() . '/inc/options/opt-config.php'; }, 20 ); /** * Register widgets */ require get_template_directory() . '/inc/widgets.php'; /** * Custom template tags for this theme. */ require get_template_directory() . '/inc/template-tags.php'; /** * Template hooks for this theme. */ require get_template_directory() . '/inc/template-hooks.php'; /** * Functions which enhance the theme by hooking into WordPress. */ require get_template_directory() . '/inc/template-functions.php'; /** * Related Items */ require get_template_directory() . '/inc/related-items.php'; /** * WooCommerce Config */ if ( class_exists( 'WooCommerce' ) ) { require get_template_directory() . '/inc/woo-config.php'; }