Pass a PHP variable to another file
Is there a simple method to passing data from one file to another? I’m new to PHP and can’t find a simple answer to my problem online. Apologies if this has been answered a million times & thanks in advance.
My Template <?php // Declare a variable with the name of the file I want to pull in $critical_css = 'style'; // Header get_header(); ?>
Header // Get php file with inline style written inside <?php get_template_part('/path/to/' . $critical_css); ?>