Title: Conditional CSS
Last modified: August 21, 2016

---

# Conditional CSS

 *  Resolved [TMCSaint](https://wordpress.org/support/users/tmcsaint/)
 * (@tmcsaint)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/)
 * Trying to set up so that if I am not looking at my homepage the content floods
   the width of the page. I have the code below in my header.php file:
 *     ```
       <?php is_front_page(); ?>
          echo '<style type="text/css">#content{width:100%;}</style>';
        <?php endif; ?>
       ```
   
 * But that only shows a blank screen when I view the page. What am I missing?

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048278)
 * > But that only shows a blank screen when I view the page. What am I missing?
 * Access your error logs to see why you’re receiving a blank screen.
 * By the way you’re closing PHP before your echo, and you don’t have an opening
   if statement.
 *  Thread Starter [TMCSaint](https://wordpress.org/support/users/tmcsaint/)
 * (@tmcsaint)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048280)
 * how do I access the error logs?
 *     ```
       <?php if ( is_front_page() ) {
       		echo '<style type="text/css">#content{width:100%;}</style>";
       	}>
                <?php endif; ?>
       ```
   
 * I modified the code to show this still same thing
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048281)
 * Your hosting providers can locate your error logs for you to access
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048282)
 * You still have a syntax error
 *  Thread Starter [TMCSaint](https://wordpress.org/support/users/tmcsaint/)
 * (@tmcsaint)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048286)
 * Ok figured out my problem:
 *     ```
       <?php if ( is_front_page() ){
       		echo '<style type="text/css">#content{width:100% !Important;}</style>';
       	} ?>
       ```
   
 * However my content isn’t flooding the page.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048288)
 * There’s no way for us to debug this without seeing the page
 *  Thread Starter [TMCSaint](https://wordpress.org/support/users/tmcsaint/)
 * (@tmcsaint)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048289)
 * [http://more.thomasmore.edu/](http://more.thomasmore.edu/)
 *  Thread Starter [TMCSaint](https://wordpress.org/support/users/tmcsaint/)
 * (@tmcsaint)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048291)
 * Ok fixed that now my other ? is why did my menus disappear on my post pages:
 * [http://more.thomasmore.edu/?p=705](http://more.thomasmore.edu/?p=705)
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048292)
 * I still see your menu on that page
 *  Thread Starter [TMCSaint](https://wordpress.org/support/users/tmcsaint/)
 * (@tmcsaint)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048293)
 * STUPID IE CACHE, thanks!

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Conditional CSS’ is closed to new replies.

 * 10 replies
 * 2 participants
 * Last reply from: [TMCSaint](https://wordpress.org/support/users/tmcsaint/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/conditional-css-3/#post-5048293)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
