/** * Theme Functions * * @package DTtheme * @author DesignThemes * @link http://wedesignthemes.com */ define( 'VIVAGH_THEME_DIR', get_template_directory() ); define( 'VIVAGH_THEME_URI', get_template_directory_uri() ); define( 'VIVAGH_CORE_PLUGIN', WP_PLUGIN_DIR.'/designthemes-core-features' ); define( 'VIVAGH_SETTINGS', 'vivagh-opts' ); global $vivaghoptions; $vivaghoptions = get_option(VIVAGH_SETTINGS); add_action( 'after_setup_theme', 'vivagh_i18n' ); if (! function_exists('vivagh_i18n')) { function vivagh_i18n() { load_theme_textdomain( 'vivagh', VIVAGH_THEME_DIR . '/languages' ); } } if (! function_exists('vivagh_load_theme_files')) { function vivagh_load_theme_files() { if (function_exists ('wp_get_theme')) : $themeData = wp_get_theme(); define( 'VIVAGH_THEME_NAME', $themeData->get('Name')); define( 'VIVAGH_THEME_VERSION', $themeData->get('Version')); if ( ! defined( 'THEME_SUPPORT_DOMAIN' ) ) { define( 'THEME_SUPPORT_DOMAIN', 'https://themessupport.com' ); } if ( ! defined( 'PLUGIN_ENDPOINT_PATH' ) ) { define( 'PLUGIN_ENDPOINT_PATH', '/plugin-server/plugins-version.php' ); } endif; /* --------------------------------------------------------------------------- * Loads Theme Textdomain * ---------------------------------------------------------------------------*/ /* --------------------------------------------------------------------------- * Loads the Admin Panel Scripts * ---------------------------------------------------------------------------*/ function vivagh_admin_scripts() { wp_enqueue_style('vivagh-admin', VIVAGH_THEME_URI .'/framework/theme-options/style.css'); wp_enqueue_style('chosen', VIVAGH_THEME_URI .'/framework/theme-options/css/chosen.css'); wp_enqueue_style('wp-color-picker'); wp_enqueue_script('jquery-ui-tabs'); wp_enqueue_script('jquery-ui-sortable'); wp_enqueue_script('jquery-ui-slider'); wp_enqueue_script('wp-color-picker'); wp_enqueue_script('wp-color-picker-alpha', VIVAGH_THEME_URI.'/framework/js/wp-color-picker-alpha.js', array(), false, true); wp_enqueue_script('jquery-browser', VIVAGH_THEME_URI . '/framework/theme-options/js/jquery.browser.min.js'); wp_enqueue_script('jquery-tools', VIVAGH_THEME_URI . '/framework/theme-options/js/jquery.tools.min.js'); wp_enqueue_script('jquery-chosen', VIVAGH_THEME_URI . '/framework/theme-options/js/chosen.jquery.min.js'); wp_enqueue_script('vivagh-dttheme', VIVAGH_THEME_URI . '/framework/theme-options/js/dttheme.admin.js', array( 'wp-blocks' )); wp_enqueue_media(); wp_localize_script('vivagh-dttheme', 'objectL10n', array( 'saveall' => esc_html__('Save All', 'vivagh'), 'saving' => esc_html__('Saving ...', 'vivagh'), 'noResult' => esc_html__('No Results Found!', 'vivagh'), 'resetConfirm' => esc_html__('This will restore all of your options to default. Are you sure?', 'vivagh'), 'importConfirm' => esc_html__('You are going to import the dummy data provided with the theme, kindly confirm?', 'vivagh'), 'backupMsg' => esc_html__('Click OK to backup your current saved options.', 'vivagh'), 'backupSuccess' => esc_html__('Your options are backuped successfully', 'vivagh'), 'backupFailure' => esc_html__('Backup Process not working', 'vivagh'), 'disableImportMsg' => esc_html__('Importing is disabled.. :), Please select atleast import type','vivagh'), 'restoreMsg' => esc_html__('Warning: All of your current options will be replaced with the data from your last backup! Proceed?', 'vivagh'), 'restoreSuccess' => esc_html__('Your options are restored from previous backup successfully', 'vivagh'), 'restoreFailure' => esc_html__('Restore Process not working', 'vivagh'), 'importMsg' => esc_html__('Click ok import options from the above textarea', 'vivagh'), 'importSuccess' => esc_html__('Your options are imported successfully', 'vivagh'), 'importFailure' => esc_html__('Import Process not working', 'vivagh'))); } add_action( 'admin_enqueue_scripts', 'vivagh_admin_scripts' ); /* --------------------------------------------------------------------------- * Loads the Options Panel * ---------------------------------------------------------------------------*/ require_once( VIVAGH_THEME_DIR .'/framework/utils.php' ); require_once( VIVAGH_THEME_DIR .'/framework/fonts.php' ); require_once( VIVAGH_THEME_DIR .'/framework/theme-options/init.php' ); /* --------------------------------------------------------------------------- * Loads Theme Functions * ---------------------------------------------------------------------------*/ // Functions -------------------------------------------------------------------- require_once( VIVAGH_THEME_DIR .'/framework/register-functions.php' ); // Header ----------------------------------------------------------------------- require_once( VIVAGH_THEME_DIR .'/framework/register-head.php' ); // Menu ------------------------------------------------------------------------- require_once( VIVAGH_THEME_DIR .'/framework/register-menu.php' ); require_once( VIVAGH_THEME_DIR .'/framework/register-mega-menu.php' ); // Hooks ------------------------------------------------------------------------ require_once( VIVAGH_THEME_DIR .'/framework/register-hooks.php' ); // Widgets ---------------------------------------------------------------------- add_action( 'widgets_init', 'vivagh_widgets_init' ); function vivagh_widgets_init() { require_once( VIVAGH_THEME_DIR .'/framework/register-widgets.php' ); } // Plugins ---------------------------------------------------------------------- require_once( VIVAGH_THEME_DIR .'/framework/register-plugins.php' ); // Portfolio Functions -------------------------------------------------------------------- if(class_exists('DTCorePlugin')) { require_once( VIVAGH_THEME_DIR .'/framework/register-portfolio-functions.php' ); } // WooCommerce ------------------------------------------------------------------ if( function_exists( 'is_woocommerce' ) ){ require_once( VIVAGH_THEME_DIR .'/framework/register-woocommerce.php' ); } // Register Gutenberg ----------------------------------------------------------- require_once( VIVAGH_THEME_DIR . '/framework/register-gutenberg-editor.php' ); } } add_action( 'after_setup_theme', 'vivagh_load_theme_files', 20 ); ?>