How to Inline CSS Content to external convert in WordPress
Here is the perfect example of a WordPress inline CSS file that put content with the various code options to design more attractive your website.
$custom_style = S7upf_Template::load_view('custom_css');
$cus_url_inline_create = get_theme_root().'/druck/assets/css/custom-inline-style.css';
file_put_contents($cus_url_inline_create, $custom_style);
wp_enqueue_style('s7upf-theme-custom-inline',$css_url.'custom-inline-style.css');
========= OR ===========
$root = dirname(dirname(dirname(dirname(dirname(__FILE__)))));
if (file_exists($root . '/wp-load.php')) {
require_once( $root . '/wp-load.php' );
} else {
$root = dirname(dirname(dirname(dirname(__FILE__))));
if (file_exists($root . '/wp-load.php')) {
require_once( $root . '/wp-load.php' );
}
}
header("Content-type: text/css; charset=utf-8");
// Content Include