$media is for specifying which type of media to load this stylesheet for, such as all (default), screen, print, or handheld.Defaults to the current WordPress version. $ver sets the version number of your stylesheet and is used for cache busting.$deps is an optional array of other stylesheet handles that your stylesheet is dependent upon.While it is technically an optional parameter, it is required to actually load a specific stylesheet. $src is the file URL of your stylesheet.$handle is a unique name/ID for the stylesheet and should be prefixed with your theme slug.Take a look at the function signature: wp_enqueue_style( You’ll learn which action hooks to use for specific scenarios in the next sections. You would use this function within an action hook callback in your functions.php file, which you learned about in Custom Functionality. Wp_enqueue_style() is the primary function for enqueueing a stylesheet, which tells WordPress that you want to put it in the queue to load. get_parent_theme_file_path( $file ): Returns the parent theme’s directory path, with an optional $file parameter. Falls back to the parent theme if a child theme is active and the file doesn’t exist. get_theme_file_path( $file ): Returns the active theme’s directory path, with an optional $file parameter.get_parent_theme_file_uri( $file ): Returns the parent theme’s URL, with an optional $file path.įor directory paths, which are needed less often for assets, there are two primary functions:.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |