/**
* Prinox functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package Prinox
*/
/**
* Define Core FIle
*/
define( 'PRINOX_THEME_DRI', get_template_directory() );
define( 'PRINOX_THEME_URI', get_template_directory_uri() );
define( 'PRINOX_CSS_PATH', PRINOX_THEME_URI . '/assets/css' );
define( 'PRINOX_JS_PATH', PRINOX_THEME_URI . '/assets/js' );
define( 'PRINOX_ICON_PATH', PRINOX_THEME_URI . '/assets/fonts/fontawesome/css' );
define( 'PRINOX_IMG_PATH', PRINOX_THEME_URI . '/assets/images' );
/**
* 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 prinox_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on Prinox, use a find and replace
* to change 'prinox' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'prinox', get_template_directory() . '/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
remove_theme_support( 'widgets-block-editor' );
/*
* 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' );
add_theme_support( 'woocommerce' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
//Custom Image Size
add_image_size( 'prinox-img-size-1', 428 , 546, true );
add_image_size( 'prinox-img-size-2', 571 , 520, true );
add_image_size( 'prinox-img-size-3', 475 , 310, true );
add_image_size( 'prinox-img-size-4', 423 , 543, true );
add_image_size( 'prinox-img-size-5', 365 , 215, true );
add_image_size( 'prinox-img-size-6', 992 , 538, true );
add_image_size( 'prinox-img-size-7', 175 , 145, true );
add_image_size( 'prinox-img-size-8', 420 , 280, true );
add_image_size( 'prinox-img-size-9', 295 , 366, true );
/*
* 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' => esc_html__( 'Main Menu', 'prinox' ),
'main_menu_two' => esc_html__( 'Main Menu Two(This menu Display Only Header Four)', 'prinox' ),
'category_menu' => esc_html__( 'Category Menu(This Menu Display Only Header Five)', 'prinox' ),
)
);
/*
* 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(
'prinox_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_action( 'after_setup_theme', 'prinox_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 prinox_content_width() {
$GLOBALS['content_width'] = apply_filters( 'prinox_content_width', 640 );
}
add_action( 'after_setup_theme', 'prinox_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function prinox_widgets_init() {
register_sidebar(
array(
'name' => esc_html__( 'Sidebar', 'prinox' ),
'id' => 'sidebar-1',
'description' => esc_html__( 'Add widgets here.', 'prinox' ),
'before_widget' => '