Support » Fixing WordPress » How To Hide Image?

  • Hello everyone!

    I would like to have a category in which all posted images are hidden from view until the viewer actually clicks on the post itself. Or something very similar to that.

    The point is to keep certain images from displaying automatically while allowing images in other categories to display normally.

Viewing 2 replies - 1 through 2 (of 2 total)
  • One approach would be to create a category template for this category that uses the_excerpt() rather than the_content(). The latter would automatically strip all formatting and images from the post summary text in the catgeory listing.

    You’d also need to edit your index.php page to handle posts from this category different using something like:

    <?php if(in_category('Special')) the_excerpt;
    else the_content();?>;

    instead of the standard <?php the_content();?>.

    Thank you. I’ll give that a try!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How To Hide Image?’ is closed to new replies.