Pārlūkot izejas kodu

Google and Picker CSS added via wp_enqueue_style

Mozahidur Rahman 1 gadu atpakaļ
vecāks
revīzija
fc161b45ac
1 mainītis faili ar 38 papildinājumiem un 26 dzēšanām
  1. 38 26
      functions.php

+ 38 - 26
functions.php

@@ -1,4 +1,5 @@
 <?php
+
 /**
  * UIU CSE functions and definitions
  *
@@ -7,9 +8,9 @@
  * @package UIU_CSE
  */
 
-if ( ! defined( '_S_VERSION' ) ) {
+if (!defined('_S_VERSION')) {
 	// Replace the version number of the theme on each release.
-	define( '_S_VERSION', '1.0.0' );
+	define('_S_VERSION', '1.0.0');
 }
 
 /**
@@ -19,17 +20,18 @@ if ( ! defined( '_S_VERSION' ) ) {
  * runs before the init hook. The init hook is too late for some features, such
  * as indicating support for post thumbnails.
  */
-function uiu_cse_setup() {
+function uiu_cse_setup()
+{
 	/*
 		* Make theme available for translation.
 		* Translations can be filed in the /languages/ directory.
 		* If you're building a theme based on UIU CSE, use a find and replace
 		* to change 'uiu-cse' to the name of your theme in all the template files.
 		*/
-	load_theme_textdomain( 'uiu-cse', get_template_directory() . '/languages' );
+	load_theme_textdomain('uiu-cse', get_template_directory() . '/languages');
 
 	// Add default posts and comments RSS feed links to head.
-	add_theme_support( 'automatic-feed-links' );
+	add_theme_support('automatic-feed-links');
 
 	/*
 		* Let WordPress manage the document title.
@@ -37,19 +39,19 @@ function uiu_cse_setup() {
 		* hard-coded <title> tag in the document head, and expect WordPress to
 		* provide it for us.
 		*/
-	add_theme_support( 'title-tag' );
+	add_theme_support('title-tag');
 
 	/*
 		* 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' );
+	add_theme_support('post-thumbnails');
 
 	// This theme uses wp_nav_menu() in one location.
 	register_nav_menus(
 		array(
-			'menu-1' => esc_html__( 'Primary', 'uiu-cse' ),
+			'menu-1' => esc_html__('Primary', 'uiu-cse'),
 		)
 	);
 
@@ -83,7 +85,7 @@ function uiu_cse_setup() {
 	);
 
 	// Add theme support for selective refresh for widgets.
-	add_theme_support( 'customize-selective-refresh-widgets' );
+	add_theme_support('customize-selective-refresh-widgets');
 
 	/**
 	 * Add support for core custom logo.
@@ -100,7 +102,7 @@ function uiu_cse_setup() {
 		)
 	);
 }
-add_action( 'after_setup_theme', 'uiu_cse_setup' );
+add_action('after_setup_theme', 'uiu_cse_setup');
 
 /**
  * Set the content width in pixels, based on the theme's design and stylesheet.
@@ -109,22 +111,24 @@ add_action( 'after_setup_theme', 'uiu_cse_setup' );
  *
  * @global int $content_width
  */
-function uiu_cse_content_width() {
-	$GLOBALS['content_width'] = apply_filters( 'uiu_cse_content_width', 640 );
+function uiu_cse_content_width()
+{
+	$GLOBALS['content_width'] = apply_filters('uiu_cse_content_width', 640);
 }
-add_action( 'after_setup_theme', 'uiu_cse_content_width', 0 );
+add_action('after_setup_theme', 'uiu_cse_content_width', 0);
 
 /**
  * Register widget area.
  *
  * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
  */
-function uiu_cse_widgets_init() {
+function uiu_cse_widgets_init()
+{
 	register_sidebar(
 		array(
-			'name'          => esc_html__( 'Sidebar', 'uiu-cse' ),
+			'name'          => esc_html__('Sidebar', 'uiu-cse'),
 			'id'            => 'sidebar-1',
-			'description'   => esc_html__( 'Add widgets here.', 'uiu-cse' ),
+			'description'   => esc_html__('Add widgets here.', 'uiu-cse'),
 			'before_widget' => '<section id="%1$s" class="widget %2$s">',
 			'after_widget'  => '</section>',
 			'before_title'  => '<h2 class="widget-title">',
@@ -132,22 +136,31 @@ function uiu_cse_widgets_init() {
 		)
 	);
 }
-add_action( 'widgets_init', 'uiu_cse_widgets_init' );
+add_action('widgets_init', 'uiu_cse_widgets_init');
 
 /**
  * Enqueue scripts and styles.
  */
-function uiu_cse_scripts() {
-	wp_enqueue_style( 'uiu-cse-style', get_stylesheet_uri(), array(), _S_VERSION );
-	wp_style_add_data( 'uiu-cse-style', 'rtl', 'replace' );
+function uiu_cse_scripts()
+{
+	wp_enqueue_style('uiu-cse-style', get_stylesheet_uri(), array(), _S_VERSION);
+	wp_style_add_data('uiu-cse-style', 'rtl', 'replace');
+
+	wp_enqueue_style('uiu-cse-pickr-nano', 'https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/themes/nano.min.css');
+
+	wp_enqueue_style('uiu-cse-google-fonts-material-icon', 'https://fonts.googleapis.com/icon?family=Material+Icons');
 
-	wp_enqueue_script( 'uiu-cse-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );
+	wp_enqueue_style('uiu-cse-google-fonts-material-symbols-outlined', 'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,0,0');
 
-	if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
-		wp_enqueue_script( 'comment-reply' );
+	wp_enqueue_style('uiu-cse-google-fonts-material+symbols+sharpt', 'https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@48,400,0,0');
+
+	wp_enqueue_script('uiu-cse-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true);
+
+	if (is_singular() && comments_open() && get_option('thread_comments')) {
+		wp_enqueue_script('comment-reply');
 	}
 }
-add_action( 'wp_enqueue_scripts', 'uiu_cse_scripts' );
+add_action('wp_enqueue_scripts', 'uiu_cse_scripts');
 
 /**
  * Implement the Custom Header feature.
@@ -172,7 +185,6 @@ require get_template_directory() . '/inc/customizer.php';
 /**
  * Load Jetpack compatibility file.
  */
-if ( defined( 'JETPACK__VERSION' ) ) {
+if (defined('JETPACK__VERSION')) {
 	require get_template_directory() . '/inc/jetpack.php';
 }
-