Hide post images but keep thumbnail image in Category archive
-
Hi basically within my home page i show my latest posts which have there own thumbnail, and within the posts there are images. however i did add the following code into “functions.php” which enabled me to hide the images but keep the thumbnail being shown:
function wpi_image_content_filter($content){
if (is_home() || is_front_page()){
$content = preg_replace(“/<img[^>]+\>/i”, “”, $content);
}
return $content;
}
add_filter(‘the_content’,’wpi_image_content_filter’,11);Basically when the post is shown in the category list the thumbnail and the images of the post are shown, which is not what i want. I want the thumbnail image to show and the post images to be hiden like at the home page.
Please help someone
- The topic ‘Hide post images but keep thumbnail image in Category archive’ is closed to new replies.