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,
Comment

enqueue css wordpress

add_action( 'init', 'enqueue_css' );
function enqueue_css(){

  wp_enqueue_style( 'myStylesheet', plugins_url( 'my-css.css', __FILE__ ) );

}
Comment

enqueue styles and scripts in wordpress

enqueue
Comment

PREVIOUS NEXT
Code Example
Php :: laravel Call to a member function diffForHumans() on string 
Php :: php strip out special characters 
Php :: where like laravel 
Php :: php get file extension from filename 
Php :: laravel command to create symlink storage 
Php :: check if includes numbers php 
Php :: php error reporting all 
Php :: php artisan route scan 
Php :: php read file line by line 
Php :: get random posts wordpress 
Php :: Composer detected issues in your platform: Your Composer dependencies require a PHP version "= 7.3.0". You are running 7.2.34 
Php :: php loop through lines of file 
Php :: laravel migation error 
Php :: php mysql timestamp format 
Php :: add a year php 
Php :: php has been blocked by CORS policy 
Php :: laravel $loop-iteration 
Php :: composer stripe 
Php :: wp_redirect to home page 
Php :: wordpress disallow_file_edit 
Php :: php directory exists 
Php :: laravel hash::check 
Php :: compare hashed password and a unhashed password in laravel 
Php :: reset wp query 
Php :: pasar datetime a string php 
Php :: laravel test assert redirecto to 
Php :: init hook wordpress 
Php :: home url wordpress 
Php :: check if table exists sql php 
Php :: php sha256 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =