Title: what does this code means
Last modified: August 2, 2019

---

# what does this code means

 *  [Alvaro](https://wordpress.org/support/users/nicardo/)
 * (@nicardo)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/what-does-this-code-means/)
 * Hello
    I have few lines of code in a theme, I did not understood, can anyone 
   explain me this. $screen = get_current_screen(); // understood this if ( $screen&&‘
   post’ == $screen->base && ‘page’ == $screen->id ) { // not sure about this line//
   code to execute something }
 * As per I have understood the code is executed when post type is post or page,
   I am not sure how, I need to add another custom post type ( playe r) in that 
   if statement.

Viewing 1 replies (of 1 total)

 *  [Joy](https://wordpress.org/support/users/joyously/)
 * (@joyously)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/what-does-this-code-means/#post-11791423)
 * I’ll write it in English.
    `if ( $screen && ‘post’ == $screen->base && ‘page’
   == $screen->id )` If the $screen variable has a value AND the $screen base equals‘
   post’ AND the $screen id equals ‘page’
 * Themes shouldn’t be doing things based on admin pages, or custom post types. 
   Put the code in a plugin.

Viewing 1 replies (of 1 total)

The topic ‘what does this code means’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Joy](https://wordpress.org/support/users/joyously/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/what-does-this-code-means/#post-11791423)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
