title: WordPress load dynamic css only on frontend
body: <p>My problem is that I use dynamic css file in the WordPress theme that is loaded with Ajax. However, it loads this same dynamic css file for backend also. How do I modify my code that it loads dynamic css file only for frontend, not for the backend. Here's my code:</p>
  
  <pre><code>wp_enqueue_style('dynamic-css',
  admin_url('admin-ajax.php?action=dynamic_css'));
  
  function dynaminc_css() {
      require(get_template_directory().'/dynamic-css.php');
      exit;
  }
  
  add_action( 'wp_ajax_dynamic_css', 'dynaminc_css' );
  add_action( 'wp_ajax_nopriv_dynamic_css', 'dynaminc_css' );
  </code></pre>
  
  <p>}</p>