I read the FAQ again and added the unique string to the CSS exception field. It still didn’t use the style from the child theme while having CSS Options checked.
if you want to exclude inline code, you’ll have to find a specific, unique string in that block of code and add that to the exclusion list. Example: to exclude <script>funky_data=’Won\’t you take me to, Funky Town'</script>, the identifier is “funky_data”.
The code snippet below from functions.php is a copy and paste of the same section from the parent theme with minor changes in the bold lines. Since the are almost identical, it was hard to find a unique string that would cause the exception in the parent but not the child and still be upgrade safe. I tried two approaches to make things unique from the parent theme.
First I deleted the line “/* Accent color */” in functions.php. This would leave only the parent theme to have the word Accent for that section of code. My thinking is Autoptimize would remove or not use that whole <style> </style> section from the parent theme. I put “Accent” in the field “Exclude CSS from Autoptimize:” so it looks like this:
admin-bar.min.css, dashicons.min.css, Accent
After saving, clearing the cache and doing a page refrest, the child theme inline CSS was still not used.
Next I tried to add this whole string (not knowing if I can have spaces in a string) in the Exclude CSS field since that line only appears in the parent theme and has been changed in the child theme:
<blockquote>box-shadow: 0 -1px 0 <?php echo $accent_color; ?> inset; </blockquote>
That didn’t work. Child theme inline CSS is still not used.
<blockquote>if ( !function_exists( 'boss_generate_option_css' ) ) {
function boss_generate_option_css() {
$accent_color = onesocial_get_option( 'accent_color' );
?>
<style>
<strong>/* Accent color */</strong>
a { color: <?php echo $accent_color; ?>; }
.widget_mc4wp_form_widget form p input[type="submit"], .widget.widget_newsletterwidget form p input[type="submit"],
.footer-widget #switch-mode input[type="submit"],
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
...
.header-button.underlined {
<strong>/* THAI: PARENT THEME- box-shadow: 0 -1px 0 <?php echo $accent_color; ?> inset; */
box-shadow: 0 0 0 <?php echo $accent_color; ?> inset;</strong>
}
...
</style><?php
}
/* Add Action */
add_action( 'wp_head', 'boss_generate_option_css', 99 );
}</blockquote>