Title: Need help with conditional statement for comments
Last modified: August 19, 2016

---

# Need help with conditional statement for comments

 *  [rughooker](https://wordpress.org/support/users/rughooker/)
 * (@rughooker)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/need-help-with-conditional-statement-for-comments/)
 * I am customizing a template page and I want to show “Tell us what you think” 
   on one category and the standard “Leave a comment” on all others. How do I do
   that?

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/need-help-with-conditional-statement-for-comments/#post-1895350)
 *     ```
       <?php if( is_category('Name') ) :?>
       [ do one thing]
       <?php else :?>
       [ do something else ]
       <?php endif;?>
       ```
   
 *  Thread Starter [rughooker](https://wordpress.org/support/users/rughooker/)
 * (@rughooker)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/need-help-with-conditional-statement-for-comments/#post-1895387)
 * For my understanding, how would this statement changed if it is used in a function?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/need-help-with-conditional-statement-for-comments/#post-1895390)
 * You would also have to use something like `global $post;` within the function
   to call the post object into the function so that its category can be checked.

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

The topic ‘Need help with conditional statement for comments’ is closed to new replies.

## Tags

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

 * 3 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [15 years, 4 months ago](https://wordpress.org/support/topic/need-help-with-conditional-statement-for-comments/#post-1895390)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
