Cache busting CSS files other than style.css
You’re using the file’s path in the first call, but its URL in the second. So it won’t work.
You’re using the file’s path in the first call, but its URL in the second. So it won’t work.
You should add a custom plugin. That’s need a PHP main file that include, register a JavaScript file. The source below should result in an plugin. You find a usable solution also in the probs below. PHP part add_action( ‘enqueue_block_editor_assets’, ‘my_gutenberg_scripts’ ); function my_gutenberg_scripts() { wp_register_script( ‘my-editor-enhancement’, plugins_url( ‘editor.js’, __FILE__ ), array( ‘wp-blocks’ ), // … Read more
WordPress body_class($class) is a nice dynamic way to load styles, js for specific body contents. If your theme doesn’t support body class add them very simply: Open the header.php (or the template that contains the <body> tag) Edit the <body> tag and make it to <body <?php body_class(); ?>> — you are Done! 🙂 Now … Read more
The wp_enqueue_style() function uses the following format and parameters: wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media=”all” ); In your case, you could try the following: <?php /** * Proper way to enqueue scripts and styles */ function namespace_theme_stylesheets() { wp_enqueue_style( ‘mamies-wafers-bootstrap-min’, get_template_directory_uri() .’/css/bootstrap.min.css’, array(), null, ‘all’ ); wp_enqueue_style( ‘mamies-wafers-carousel’, get_template_directory_uri() … Read more
wp_print_scripts is the action that runs when scripts are output to the template. wp_register_script and wp_enqueue_script are functions for registering/enqueueing scripts to be output when wp_print_scripts runs. you can’t register or enqueue styles in the wp_print_scripts action hook because styles have already been output in the wp_print_styles hook, which runs before wp_print_scripts. refer to the … Read more
There’s a new core “Section” block that will be available in an upcoming Gutenberg update which is intended to serve the role you’re looking for I think: Add Section block
Enqueue the style.css too, and set normalize as dependency: if ( ! is_admin() ) { // Register early, so no on else can reserve that handle add_action( ‘wp_loaded’, function() { wp_register_style( ‘normalize’, // parent theme get_template_directory_uri() . ‘/css/normalize.css’ ); wp_register_style( ‘theme_name’, // current theme, might be the child theme get_stylesheet_uri(), [ ‘normalize’ ] ); }); … Read more
I copy pasted your code into my dev environment, changed nothing but the page name, and it works just fine. Are you sure that it’s not being enqueued and you just have it pointed wrong or that the page is not named incorrectly or something?
Theme stylesheets aren’t usually enqueued, they’re normally loaded using.. <link rel=”stylesheet” type=”text/css” media=”all” href=”https://wordpress.stackexchange.com/questions/14655/<?php bloginfo(“stylesheet_url’ ); ?>” /> So naturally you don’t see them(it) in the styles array.. You can of course(if you prefer) use an enqueue instead.
Try enqueuing your child theme’s CSS like so: // Queue parent style followed by child/customized style add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’, PHP_INT_MAX); function theme_enqueue_styles() { wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ ); wp_enqueue_style( ‘child-style’, get_stylesheet_directory_uri() . ‘/styles/child-style.css’, array( ‘parent-style’ ) ); } Notice a few things: 1) PHP_INT_MAX as priority so that this runs last 2) get_stylesheet_directory_uri() vs. … Read more