Stylesheet version not showing in browser when adding version number to stylesheet in enqueue

It appears you’re using the Sage theme framework – presumably you’re also using Soil? One of Soil’s modules explicitly disables asset versioning – ensure that you haven’t enabled in it in your theme by way of add_theme_support( ‘soil-disable-asset-versioning’ ); or add_theme_support( ‘soil’, [ ‘disable-asset-versioning’ ] ); If Soil is not responsible it could be any … Read more

Why do WordPress adds the id=”handle-{js|css}” attribute to scripts and stylesheet?

The id attribute was added to the <style> tags in WordPress v4.1 (2014) — see the Trac changesets 29956 and 29958 which both mentioned ticket #30032 (“Add ID attribute to style element from wp_add_inline_style()“): In order to support partial preview refreshes (#27355), it is important for all partials being updated to have an element with … Read more

How to create my own style.css file in an wordpress child-theme

Take a look at the official docs: https://codex.wordpress.org/Child_Themes https://developer.wordpress.org/themes/advanced-topics/child-themes/ Make sure you are within your child theme functions.php and use this code to make sure the function is firing. It will kill the page if it is working correctly. function wpdocs_theme_name_scripts() { wp_die(‘Yep! This is working’); } add_action( ‘wp_enqueue_scripts’, ‘wpdocs_theme_name_scripts’ );

Why is wp_enqueue_style not working?

I figured out the problem. It was working all along. The site I’m working on had installed a plugin called ‘Autoptimize’ which will shove all your CSS into an inline <style> tag. I was trying to search the output HTML for a reference to my CSS file, but it wasn’t there, because this plugin was … Read more

How to laod wp_enqueue_style to another header i created my self

WordPress features a very robust template hierarchy that should be observed, take a look at wphierarchy.com. If you needed two header formats for some reason, you could create a file in the theme root called header-manga.php which you could then call in your page template with <?php get_header( ‘manga’ ); ?>. Once you have your … Read more