Are You Frustrated With Your Blog Or Website?

Do you want to start a blog but don't know how? Let me show you! Or do you have a blog that you want to do more with? Let me help! Is all your time taken up with maintenance and you wish you could concentrate on the writing? Let me reclaim your time!

Joel Williams

Blog Tech Guy

Taking care of the
technical side of blogging!

How To Add A Caption To Your Photos In Wordpress

View Comments

It’s been at least, oh I don’t know, maybe three people who have asked me how this can be done.

First, I find it best to resize the image to the size you want it before uploading then it’s easier to work with.

Then to add a caption I usually like to add a CSS class and wrap a div around the photo to style it. If that sounds like gibberish then you could just try something like the following code in the HTML part tab of the visual editor:

test code

After each photo. This makes the text 90% of the standard size, in italics and grey/gray.

If you wanted to do this the CSS way, you would add something like this to your themes style.css

.photocaption {
font-size: 90%;
font-style: italic;
color: #999999;
}

Then in a post would write this:

Caption text here

The text would then be styled as before. Notice the “hard return” before the caption text i.e. it starts on a new line, otherwise the caption text would start next to the photo and not below it. It is possible to automatically wrap text at a certain width, but let’s not confuse matters.

You could of course also set a background colour, float the image right or left and many other things.

Hope that hasn’t confused you too much!

Related Posts with Thumbnails
  • Thanks Muhammad. If you have AWeber it's simple to check your list by logging in and looking at your subscriber information in Reports.
  • I have added the subscribe option provided by your site successfully. now i want to know that how could i check my subscribers list. i want to check whom subsribe to my blog.
  • Awesome! Thanks!
  • Thanks Adrian, probably a more elegant way of doing it, but it all works :)

    For the code I use Dean's Code Highlighter, I previously tried the Google code but this is excellent.
  • I used the CSS version, but put the style on a span tag, inside the p with the image. ;)

    By the way... what are you using the display code? Is it a plugin? I use a Google tool, but it's kind of slow.
blog comments powered by Disqus
  • Search

    Search Form
  • Subscribe To My Newsletter

    Income Blogging Guide Blueprint
    Get your FREE Income Blogging Guide Blueprint when you subscribe today!
  • WordPress Training Videos

  • Other BTG Free Resources




  • Join BTG on Facebook!

    Blog Tech Guy on Facebook
  • Questions & Answers

  • Recent Blog Entries

  • Archives

  • Topics