$custom_style = 'css/pre/custom-styles.css';
function custom_stylesheet() {
wp_enqueue_style( 'aps-custom-style', APS_URL .$custom_style, APS_VER );
}
add_action( 'wp_enqueue_scripts', 'custom_stylesheet' );
APS_URL is the url of directory.
$custom_style = 'css/pre/custom-styles.css';
function custom_stylesheet() {
wp_enqueue_style( 'aps-custom-style', APS_URL .$custom_style, APS_VER );
}
add_action( 'wp_enqueue_scripts', 'custom_stylesheet' );
APS_URL is the url of directory.
You have to pass it to the function:
$custom_style = 'css/pre/custom-styles.css';
function custom_stylesheet($custom_style) {
wp_enqueue_style( 'aps-custom-style', APS_URL .$custom_style, APS_VER );
}
add_action( 'wp_enqueue_scripts', 'custom_stylesheet' );
or declare it global:
$custom_style = 'css/pre/custom-styles.css';
function custom_stylesheet() {
global $custom_style;
wp_enqueue_style( 'aps-custom-style', APS_URL .$custom_style, APS_VER );
}
add_action( 'wp_enqueue_scripts', 'custom_stylesheet' );
wp_enqueue_style( string $handle, string $src = '', array $deps = array(), string|bool|null $ver = false, string $media = 'all' )
https://developer.wordpress.org/reference/functions/wp_enqueue_style/
You should pass an array as $deps argument first, before $vers argument.