themes-wordpress/ctlg/functions.php

59 lines
954 B
PHP
Raw Normal View History

<?php
/**
2023-03-22 15:40:20 +00:00
* CTLG functions and definitions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
2023-03-22 15:40:20 +00:00
* @package CTLG
* @since CTLG 1.0
*/
2023-03-22 15:40:20 +00:00
if ( ! function_exists( 'ctlg_support' ) ) :
/**
* Sets up theme defaults and registers support for various WordPress features.
*
2023-03-22 15:40:20 +00:00
* @since CTLG 1.0
*
* @return void
*/
2023-03-22 15:40:20 +00:00
function ctlg_support() {
// Enqueue editor styles.
add_editor_style( 'style.css' );
}
endif;
2023-03-22 15:40:20 +00:00
add_action( 'after_setup_theme', 'ctlg_support' );
2023-03-22 15:40:20 +00:00
if ( ! function_exists( 'ctlg_styles' ) ) :
/**
* Enqueue styles.
*
2023-03-22 15:40:20 +00:00
* @since CTLG 1.0
*
* @return void
*/
2023-03-22 15:40:20 +00:00
function ctlg_styles() {
// Register theme stylesheet.
wp_register_style(
2023-03-22 15:40:20 +00:00
'ctlg-style',
get_stylesheet_directory_uri() . '/style.css',
array(),
wp_get_theme()->get( 'Version' )
);
// Enqueue theme stylesheet.
2023-03-22 15:40:20 +00:00
wp_enqueue_style( 'ctlg-style' );
}
endif;
2023-03-22 15:40:20 +00:00
add_action( 'wp_enqueue_scripts', 'ctlg_styles' );