title: Changing CSS Style using PHP in WordPress
body: <p>I'm somewhat new to PHP and WordPress and I'm trying style a menu plugin (their support is busy) based on what page the user is on. 
  <br><br>
  What I want is for the background and other styles to change if it isn't on the front page.</p>
  
  <p>I've tested the CSS in inspect element so the selectors are correct, but I don't really know how to implement this in a clean and effective way. 
  <br><br>
  The messy way would be to create another two menus (because top_navigation and main_menu are separate so 4 total) style those in their plugin settings and replace the two menus on the front page with two other ones when not on the front page using php. So if I need to make a change the menu's items I'd have to do it for two or four times which to me is stupid.</p>
  
  <hr>
  
  <p>So far I've come up with creating a PHP variant of the style sheet and rewriting the URL to redirect from .css to .php however I don't really have a firm grasp on how I would do this from the root directory's .htaccess as the location of the two style sheets are far from it.</p>
  
  <p>Location of style sheets:<code>/wp-content/plugins/hmenu/_frontend_files/_menu_5/_css</code>
  <br>
  Name of style sheets: <code>hero_menu_styles.css</code> and <code>hero_menu_styles.php</code>
  <br>
  PHP Style sheet:</p>
  
  <pre><code>&lt;?php 
  header('Content-type: text/css; charset: UTF-8'); 
  ?&gt;
  
  /*  Normal CSS Here */
  
  &lt;?php 
  if(!is_front_page())
  {
  echo "#hmenu_load_5 .hmenu_main_holder {background-color: #67b7e1;}"
  }
  ?&gt;
  </code></pre>
  
  <p>.htaccess:
  <br>
  I am almost 100% sure there is something wrong with this.
  <br>
  I have no idea what though.</p>
  
  <pre><code># BEGIN WordPress
  
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase "/wp-content/plugins/hmenu/_frontend_files/_menu_5/_css/"
  RewriteRule ^hero\_menu\_styles\.css$ hero\_menu\_styles\.php [L]
  &lt;/IfModule&gt;
  
  &lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
  &lt;/IfModule&gt;
  
  # END WordPress
  </code></pre>
  
  <hr>
  
  <p>So I have a bunch of questions.</p>
  
  <ol>
  <li>
  Does echo work the way that I'm currently writing it assuming that it is in a stylesheet.php rather than a stylesheet.css?
  </li>
  <li>
  What if I were to reference an additional stylesheet.php on all my pages and just put it in there rather than rewriting my URLs? Is there a way to make sure it would override the other stylesheets?
  </li>
  
  <li>
  Can I have multiple .htaccess files 
  <br>
  (for example in /wp-content/plugins/hmenu/_frontend_files/_menu_5/_css) 
  <br>
  so I don't have to bother with long RewriteBase headaches?
  </li>
  
  <li>
  Am I correct in that I cannot just stick this code+css into my WordPress theme's header.php or functions.php?
  </li>
  
  <li>
  Do I need to require('/wp-load.php'); or load some WordPress functions (no idea what other than wp-load though) on my .php stylesheet if I wanted to use is_front_page()?
  </li>
  </ol>