Title: Need some simple PHP help
Last modified: August 19, 2016

---

# Need some simple PHP help

 *  [bradleysue](https://wordpress.org/support/users/bradleysue/)
 * (@bradleysue)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/need-some-simple-php-help/)
 * Hi there, php experts.
 * How do you combine conditions in a conditional php statement?
    If this is a single
   post AND is in category(‘blah blah’) [then show the ShareThis widget – have the
   php for this]
 * Thanks for your help…

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

 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/need-some-simple-php-help/#post-1279235)
 * I believe this will help you along …
 *     ```
       if ( is_single() && in_category('blah blah') ) {
         // Share_This widget code
       }
       ```
   
 *  Thread Starter [bradleysue](https://wordpress.org/support/users/bradleysue/)
 * (@bradleysue)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/need-some-simple-php-help/#post-1279241)
 * Thank-you cais, that’s perfect.
    One other question – how do I say NOT in category(‘
   blah blah’).
 * In other words – if is single and NOT in category=blah blah then share-this widget
   code
 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/need-some-simple-php-help/#post-1279270)
 * The exclamation mark ( ! ) is used for ‘not’, such as:
 *     ```
       if ( is_single() && !in_category('blah blah') ) {
         // Share_This widget code
       }
       ```
   
 *  Thread Starter [bradleysue](https://wordpress.org/support/users/bradleysue/)
 * (@bradleysue)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/need-some-simple-php-help/#post-1279279)
 * Wow, thanks so much for your help.
 *  [Edward Caissie](https://wordpress.org/support/users/cais/)
 * (@cais)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/need-some-simple-php-help/#post-1279293)
 * You’re welcome.

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

The topic ‘Need some simple PHP help’ is closed to new replies.

 * 5 replies
 * 2 participants
 * Last reply from: [Edward Caissie](https://wordpress.org/support/users/cais/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/need-some-simple-php-help/#post-1279293)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
