Hide an image in a wordpress post

Hide a image in a wordpress post

This is a helpful reminder to myself more than anyone else really, as I keep forgetting the code for hiding an image in a wordpress post everytime I try to hide a blog post image in there for my Pinterest page.

Some images look just odd on your blog, but work on pinterest. So to hide them from your blog viewers you can:

  1. Upload the image as normal to your wordpress media gallery
  2. Insert it where you want in your post
  3. Go in to the text tab of your wordpress post and find where the code is for the image – it should look something like <img class=”alignnone size-medium wp-image-2396″ src=”https://somemadeupblogURL.com/imageexample” alt=”” width=”300″ height=”235″ />
  4. add this code before the start of the image code ( the one that starts <img class)

    <div style = “display:none;”>

 

5. add this code after the code for the image

         </div>

I’ve added the code in as text above so that you can copy and paste it if you need to!