You could suppress the bulk of images by filtering ‘the_content’ and stripping out all <img>
tags if `$_SERVER[‘HTTP_HOST’] contains the 0 sub-domain. You can suppress others on a case by case basis. For instance, adding a conditional to headers.php could suppress the header image. Some images, such as navigation and icons, might be useful and small enough to not be worth suppressing.
Hi bcworkz and thanks for your answer!
How to filter ‘the_content’ and strip out all <img> tags if `$_SERVER[‘HTTP_HOST’] contains the 0 sub-domain?
The code would be something like this (untested):
add_filter('the_content', 'ir_remove_img_tags');
function ir_remove_img_tags( $content ) {
if ( strpos('0.', $_SERVER['HTTP_HOST'])!== false ) $content = preg_replace('/<img.*>/i', '', $content);
return $content;
}
The code can go in your theme’s (preferably child theme’s) functions.php file, or it can be made into a basic plugin. This only removes img tags from post content, other images, such as the header image, need additional code to suppress.
Note that besides matching a 0 subdomain, this will match a 0 at the end of a domain name, such as www.justinbieberisa0.com
.
A bit late, but thank you!