فهرست منبع

add functions.php

Ben Dwyer 3 سال پیش
والد
کامیت
1725180b70
1فایلهای تغییر یافته به همراه57 افزوده شده و 0 حذف شده
  1. 57 0
      rainfall/functions.php

+ 57 - 0
rainfall/functions.php

@@ -0,0 +1,57 @@
+<?php
+/**
+ * Rainfall functions and definitions
+ *
+ * @link https://developer.wordpress.org/themes/basics/theme-functions/
+ *
+ * @package Rainfall
+ * @since Rainfall 1.0
+ */
+
+
+if ( ! function_exists( 'rainfall_support' ) ) :
+
+	/**
+	 * Sets up theme defaults and registers support for various WordPress features.
+	 *
+	 * @since Rainfall 1.0
+	 *
+	 * @return void
+	 */
+	function rainfall_support() {
+
+		// Enqueue editor styles.
+		add_editor_style( 'style.css' );
+	}
+
+endif;
+
+add_action( 'after_setup_theme', 'rainfall_support' );
+
+if ( ! function_exists( 'rainfall_styles' ) ) :
+
+	/**
+	 * Enqueue styles.
+	 *
+	 * @since Archeo 1.0
+	 *
+	 * @return void
+	 */
+	function rainfall_styles() {
+
+		// Register theme stylesheet.
+		wp_register_style(
+			'rainfall-style',
+			get_template_directory_uri() . '/style.css',
+			array(),
+			wp_get_theme()->get( 'Version' )
+		);
+
+		// Enqueue theme stylesheet.
+		wp_enqueue_style( 'rainfall-style' );
+
+	}
+
+endif;
+
+add_action( 'wp_enqueue_scripts', 'rainfall_styles' );