Title: PHP code question
Last modified: August 20, 2016

---

# PHP code question

 *  [cucalon.j](https://wordpress.org/support/users/cucalonj/)
 * (@cucalonj)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/php-code-question-1/)
 * I am trying to use two different style-sheets. One for the whole page, and a 
   separate style-sheet for the shop page.
 * I am new to php and I tried using this if else statement at the header, that 
   does actually work but backwards.
 * <?php if( is_page(‘shop-2’) ) :?>
    <link rel=”stylesheet” type=”text/css” href
   =”<?php bloginfo(‘stylesheet_url’); ?>” media=”screen” /> <?php else :?> <link
   rel=”stylesheet” type=”text/css” href=”<?php bloginfo(‘template_directory’); ?
   >/shop.css” media=”screen” /> <?php endif;?>
 * I was hoping someone knew enough php to help me invert it.I can’t seem to find
   the right syntax for php.
 * <?php if( is(NOT)_page(‘shop-2’) ) :?>
 * Thank you!

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

 *  [michael.mariart](https://wordpress.org/support/users/michaelmariart/)
 * (@michaelmariart)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/php-code-question-1/#post-3192679)
 * You are close. The “not if” syntax is:
 * `if (!is_page('shop-2'))`
 * The ! means “if not true” pretty much.
 *  Thread Starter [cucalon.j](https://wordpress.org/support/users/cucalonj/)
 * (@cucalonj)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/php-code-question-1/#post-3192690)
 * Michael,
 * Thank you very, but very much. I had tried a few combinations of “is not”, even
   is!_page. But I did not try the other way around. You just saved me hours and
   hours of more scrambling to fix such a small problem.
 * I appreciate it immensely, sincerely. Thank you!

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

The topic ‘PHP code question’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [php wordpress](https://wordpress.org/support/topic-tag/php-wordpress/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [cucalon.j](https://wordpress.org/support/users/cucalonj/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/php-code-question-1/#post-3192690)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
