Skip to content

Instantly share code, notes, and snippets.

@mwhiteley16
Created December 12, 2022 14:49
Show Gist options
  • Save mwhiteley16/b78da1f07b0b711513bdd41d73537477 to your computer and use it in GitHub Desktop.
Save mwhiteley16/b78da1f07b0b711513bdd41d73537477 to your computer and use it in GitHub Desktop.
CSS Output for Feast
<?php
// function to output all the CSS
function feast_output_css() {
if ( function_exists( 'feast_css' ) ) {
$output = '';
$output .= '<style id="id-goes-here">';
feast_css();
$output .= '</style>';
echo $output;
}
}
add_action( 'wp_head', 'feast_output_css' );
// example function for how to add CSS to the inline CSS output
function example_css_output() {
$output = <<<'EOD'
.my-selector {
color: blue;
}
EOD;
echo $output;
}
add_action ( 'feast_css', 'example_css_output' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment