Search
 
SCRIPT & CODE EXAMPLE
 

PHP

wp enqueue styles

/** 
 *   Enqueue your theme styles and scripts in functions.php
 *   use time() instead of a proper versioning to avoid caching when developing
 */
function my_theme_enqueue_scripts() {
    wp_enqueue_style( 'default-style', get_stylesheet_uri(), [], '1.0.0', 'all' ); //default styles.css
    wp_enqueue_style( 'main-style', get_stylesheet_directory_uri() . '/assets/css/main.min.css', [], time(), 'all' );
    wp_enqueue_script( 'main-script', get_stylesheet_directory_uri() . '/assets/js/main.min.js', [], time(), false );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_scripts' );
Comment

wp enqueue style

/** 
 *   Enqueue your theme styles and scripts in functions.php
 *   use time() instead of a proper versioning to avoid caching when developing
 */
function my_theme_enqueue_scripts() {
    wp_enqueue_style( 'default-style', get_stylesheet_uri(), [], '1.0.0', 'all' ); //default styles.css
    wp_enqueue_style( 'main-style', get_stylesheet_directory_uri() . '/assets/css/main.min.css', [], time(), 'all' );
    wp_enqueue_script( 'main-script', get_stylesheet_directory_uri() . '/assets/js/main.min.js', [], time(), false );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_scripts' );
Comment

wp_enqueue_style

wp_enqueue_style( 'my-style', get_template_directory_uri() . '/css/my-style.css', false, '1.0', 'all' ); // Inside a parent theme
wp_enqueue_style( 'my-style', get_stylesheet_directory_uri() . '/css/my-style.css', false, '1.0', 'all' ); // Inside a child theme
wp_enqueue_style( 'my-style', plugins_url( '/css/my-style.css', __FILE__ ), false, '1.0', 'all' ); // Inside a plugin
Comment

wp enqueue style

wp_enqueue_style( 'my-style', get_template_directory_uri() . '/css/my-style.css', false, '1.0', 'all' ); // Inside a parent theme
wp_enqueue_style( 'my-style', get_stylesheet_directory_uri() . '/css/my-style.css', false, '1.0', 'all' ); // Inside a child theme
wp_enqueue_style( 'my-style', plugins_url( '/css/my-style.css', __FILE__ ), false,
Comment

PREVIOUS NEXT
Code Example
Php :: php get array key by value multidimensional 
Php :: php multi type parameter union types 
Php :: Auth::routes(); why display error in route laravel 8 
Php :: laravel display error message 
Php :: how to pass variable in inside function into where in laravel 
Php :: how to get the current year in php 
Php :: How To Force Redirect HTTP To HTTPS In Laravel Using htaccess 
Php :: add custom user meta and display it in user page 
Php :: php to int 
Php :: how to load data from .env file in php 
Php :: publish config laravel 
Php :: if browser url is having domain in it check using php 
Php :: how to search two needle in an array in_array php 
Php :: post type taxonomy loop wordpress 
Php :: laravel group by on subquery 
Php :: php date modify plus 1 day 
Php :: base url in php 
Php :: Laravel query child from parent whereHas 
Php :: laravel query builder sum 
Php :: php artisan vendor:publish 
Php :: request get query string laravel 
Php :: PHP strtotime() Function 
Php :: add to collection laravel 
Php :: send mail test from laravel 
Php :: php get current time and date 
Php :: php needle haystack 
Php :: validation not exists with this id laravel 
Php :: php get first 10 elements of array 
Php :: how validate if one parameter is exist another parameter must exist in laravel 
Php :: add blade in blade laravel 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =