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)
Viewing 1 replies (of 1 total)
- The topic ‘is_page conditional statement issue’ is closed to new replies.