Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme

Ok, the first-thing I wanted to double-check is that rather than make any modifications to parent PHP, you simply create one with a duplicate name in the child directory which completely overrides the parent file? No. You don’t create a theme with the same name. You create a theme with whatever name you choose and … Read more

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