child parent styles enqueue order

Looking at the id’s in your rendered code, the name of your parent style seems to be ‘basic-css’. That would mean you need array(‘basic-css’) as the dependency in your wp_enqueue_style. However, in the code the child style seems to be called ‘defaultbasic-css’, while you enqueue it as ‘child-style’. So it looks like there is some … Read more

How to pass variables from one function to another or combine functions

There are 2 ways that would be the most simple. Do it with a function call. Make the variables global. The first would be done like so: function my_func() { $styles=”stuff”; second_func($styles); } function second_func($styles) { // do something with $styles var_dump($styles); } The second way would be done like so: // Set global variable … Read more

I want to set global directory locations for my CSS and JS locations. How?

Sure you can do that. Create a simple plugin that looks something like this: <?php /* Plugin Name: SiteWide Assets Location Plugin URI: www.mysite.com Description: Global URI for commonly used CSS and JS files Version: 1.0 Author: Me License: None */ define( ‘SYSTEM_ASSETS’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/somedirectory/’ ); Then, store your .css and .js files there … Read more

First element/selector of enqueued CSS file breaks

Have you checked this document? https://codex.wordpress.org/Child_Themes I meant this in particular: If your child theme style.css contains actual CSS code (as it normally does), you will need to enqueue it as well. Setting ‘parent-style’ as a dependency will ensure that the child theme stylesheet loads after it. Including the child theme version number ensures that … Read more