Title: is_page conditional statement issue
Last modified: August 20, 2016

---

# is_page conditional statement issue

 *  [metallikat79](https://wordpress.org/support/users/metallikat79/)
 * (@metallikat79)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/is_page-conditional-statement-issue/)
 * Hi,
 * I am currently using a custom theme where I have a page which displays posts 
   from a particular category. For this page only I need to strip the images from
   content which is displayed but it does not seem to be working.
    I have placed
   the following code in my functions.php doc:
 *     ```
       if (is_page(305)) {
       add_filter('the_content', 'strip_images', 2);
       function strip_images($content){
          return preg_replace('/<img[^>]+./','',$content);
       }
       }
       ```
   
 * However, this does not seem to be working. I am guessing this is because I am
   not actually displaying the content of page 305, but because I am querying posts
   from a particular category using this page. How can I strip the images out of
   the content I am displaying for this page only? I do, however, need to show images
   in the content when I am viewing the post fully using single.php.
 * Thanks.

Viewing 1 replies (of 1 total)

 *  Thread Starter [metallikat79](https://wordpress.org/support/users/metallikat79/)
 * (@metallikat79)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/is_page-conditional-statement-issue/#post-3405117)
 * I managed to do it using CSS, but if anybody could share with me how to do it
   properly I would greatly appreciate it. Thanks

Viewing 1 replies (of 1 total)

The topic ‘is_page conditional statement issue’ is closed to new replies.

## Tags

 * [if statement](https://wordpress.org/support/topic-tag/if-statement/)
 * [Query category](https://wordpress.org/support/topic-tag/query-category/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [metallikat79](https://wordpress.org/support/users/metallikat79/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/is_page-conditional-statement-issue/#post-3405117)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
