Title: Restrict Content if
Last modified: August 20, 2016

---

# Restrict Content if

 *  [Ashkir](https://wordpress.org/support/users/ashkir/)
 * (@ashkir)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/restrict-content-if/)
 * Hi there! I’ve been using this to show things to administrators only:
 * `<?php if(current_user_can('administrator')): ?>`
 * How would I go about to adding the “editor” role to it? I tried this but it didn’t
   work.
 * `<?php if(current_user_can('administrator,editor')): ?>`

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

 *  [Alessio Lo Vecchio](https://wordpress.org/support/users/youon/)
 * (@youon)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/restrict-content-if/#post-2525265)
 * I’m not a php programmer but hope this may works… or something like that 🙂
 * `<?php if(current_user_can('administrator') || current_user_can('editor')): ?
   >`
 *  [Alessio Lo Vecchio](https://wordpress.org/support/users/youon/)
 * (@youon)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/restrict-content-if/#post-2525266)
 * Or probably you can define an array 😉

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

The topic ‘Restrict Content if’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Alessio Lo Vecchio](https://wordpress.org/support/users/youon/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/restrict-content-if/#post-2525266)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
