I have wordpress theme and I want to add custom css

So I try to add to header

<style>
<?php if (!empty($btn_color)){  ?> 
.btn-default{ background-color:<?php echo esc_attr($btn_color);?>; } <?php } ?>
</style>

But it seems it isn’t good way and I need to use

wp_add_inline_style() 

So how to use this function?

Read more here: Add inline css to theme


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: