I am learning wordpress theme development. I want to change some styles in my theme option page. here is the css code
background: #<?php echo esc_attr( get_option('header_bg') ); ?>;
Theme option page
register_setting('theme-setting-group','header_bg');
CSS file location : E:\xampp\htdocs\wordpress\wp-content\themes\theme-file\css\style.php Theme option file: E:\xampp\htdocs\wordpress\wp-content\themes\theme-file\functions.php
I also added this in my css php file
<?php header("Content-type: text/css", true);?>
when I put those css style in header.php it works fine. But in css php file it is showing this
Fatal error: Call to undefined function esc_attr() in E:\xampp\htdocs\wordpress\wp-content\themes\theme-file\css\style.php on line 28