• Hey guys, this has been driving me nuts for the past hour. I have a dynamic stylesheet using php (yes, it is saved as a .php filed and has header”Content-type: text/css” at the top). The stylesheet is loading fine, as well as the other variables, but I’m having trouble with the if(is_page()) conditional tag. Here’s the code:

    .who-we-are-nav {
    	<?php if (is_page('About Us')) { $whowearenav = 'font-size: 17px; '; } else { $whowearenav = ''; } ?>
    	<?php echo $whowearenav; ?>
    }

    This is driving me crazy because I had it working before. But then I had to add some styling in the code, and it stopped loading on the site. Then in notepad++ I undid everything to get it back to where it was loading on the site, but then it still wasn’t working! When I inspect the css on the client side, there is nothing showing up for the .who-we-are-nav class.

  • The topic ‘Trouble with wordpress function in css’ is closed to new replies.