403Webshell
Server IP : 66.29.132.124  /  Your IP : 3.139.69.138
Web Server : LiteSpeed
System : Linux business141.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : wavevlvu ( 1524)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/wavevlvu/tacafoundation.org/wp-content/themes/charite/inc/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/wavevlvu/tacafoundation.org/wp-content/themes/charite/inc/class-charite-init.php
<?php

/**
 * theme init class
 * */
if (!defined('ABSPATH')) {
	exit(); //exit if access directly
}

if (!class_exists('Charite_Init')) {

	class Charite_Init
	{

		private static $instance;

		public function __construct()
		{
			//theme setup
			add_action('after_setup_theme', array($this, 'theme_setup'));
			//widget init
			add_action('widgets_init', array($this, 'widgets_init'));
			//theme assets
			add_action('wp_enqueue_scripts', array($this, 'theme_assets'));
		}

		/**
		 * getInstance();
		 * @since 1.0.0
		 * */
		public static function getInstance()
		{
			if (null == self::$instance) {
				self::$instance = new self();
			}

			return self::$instance;
		}

		/**
		 * theme setup
		 * @since 1.0.0
		 * */
		public function theme_setup()
		{
			/*
		 * Make theme available for translation.
		 * Translations can be filed in the /languages/ directory.
		 * If you're building a theme based on charite, use a find and replace
		 * to change 'charite' to the name of your theme in all the template files.
		 */
			load_theme_textdomain('charite', 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 <title> tag in the document head, and expect WordPress to
			 * provide it for us.
			 */
			add_theme_support('title-tag');

			// Set post thumbnail size.
			set_post_thumbnail_size(845, 412, 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(
				'main-menu' => esc_html__('Primary Menu', 'charite'),
			));

			// editor style
			add_editor_style();

			/*
			 * 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',
			));

			// Set up the WordPress core custom background feature.
			add_theme_support('custom-background', apply_filters('charite_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'      => 150,
				'width'       => 300,
				'flex-width'  => true,
				'flex-height' => true,
			));

			// This variable is intended to be overruled from themes.
			// Open WPCS issue: {@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1043}.
			// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
			$GLOBALS['content_width'] = apply_filters('charite_content_width', 640);


			//load theme dependency files
			$this->include_files();
		}


		/**
		 * widgets_init
		 * @since 1.0.0
		 * */
		public function widgets_init()
		{

			register_sidebar(array(
				'name'          => esc_html__('Sidebar', 'charite'),
				'id'            => 'sidebar-1',
				'description'   => esc_html__('Add Sidebar widgets here.', 'charite'),
				'before_widget' => '<div id="%1$s" class="widget %2$s widget-border">',
				'after_widget'  => '</div>',
				'before_title'  => '<h4 class="widget-title">',
				'after_title'   => '</h4>',
			));
		}

		/**
		 * include files
		 * @since 1.0.0
		 * */
		public function include_files()
		{

			require_once get_template_directory() . '/inc/breadcrumb.php';

			require_once get_template_directory() . '/inc/class-charite-general-hooks.php';

			require_once get_template_directory() . '/inc/plugins/tgma/activate.php';
		}

		/**
		 * theme assets
		 * @since 1.0.0
		 * */
		public function theme_assets()
		{
			$this->theme_css();
			$this->theme_js();
		}

		/*
		*charite load font
		*/
		public static function charite_fonts_url()
		{

			$font_url = '';

			/*
			Translators: If there are characters in your language that are not supported
			by chosen font(s), translate this to 'off'. Do not translate into your own language.
			 */
			if ('off' !== _x('on', 'Google font: on or off', 'charite')) {
				$font_url = add_query_arg(
					'family',
					urlencode('DM Sans|Pacifico|Nunito:400,600,700,800&display=swap'),
					"https://fonts.googleapis.com/css"
				);
			}

			return esc_url_raw($font_url);
		}

		/**
		 * theme css
		 * @since 1.0.0
		 * */
		public function theme_css()
		{
			wp_enqueue_style('charite-font', self::charite_fonts_url(), array(), CHARITE_VERSION, 'all');
			wp_enqueue_style('charite-custom-icon', CHARITE_CSS . '/flaticon.min.css', array(), CHARITE_VERSION, 'all');
			wp_enqueue_style('fontawesome', CHARITE_CSS . '/fontawesome.min.css', array(), CHARITE_VERSION, 'all');
			wp_enqueue_style('bootstrap', CHARITE_CSS . '/bootstrap.min.css', array(), CHARITE_VERSION, 'all');
			wp_enqueue_style('spacing', CHARITE_CSS . '/spacing.min.css', array(), CHARITE_VERSION, 'all');
			wp_enqueue_style('meanmenu', CHARITE_CSS . '/meanmenu.css', array(), CHARITE_VERSION, 'all');
			wp_enqueue_style('charite-main-style', CHARITE_CSS . '/style.css', array(), CHARITE_VERSION, 'all');
			wp_enqueue_style('charite-style', get_stylesheet_uri());
		}

		/**
		 * theme js
		 * @since 1.0.0
		 * */
		public function theme_js()
		{

			wp_enqueue_script('bootstrap',  CHARITE_JS . '/bootstrap.min.js', array('jquery'), CHARITE_VERSION, true);
			wp_enqueue_script('meanmenu',  CHARITE_JS . '/meanmenu.js', array('jquery'), CHARITE_VERSION, true);
			wp_enqueue_script('charite-main-script',  CHARITE_JS . '/main.js', array('jquery'), CHARITE_VERSION, true);

			if (is_singular() && comments_open() && get_option('thread_comments')) {
				wp_enqueue_script('comment-reply');
			}
		}
	} //end class

	Charite_Init::getInstance();
}

Youez - 2016 - github.com/yon3zu
LinuXploit