How to change alignment of jetpack image widget caption in right sidebar

Hi Everyone

I have just put together a new travel blog site at using colorlib’s Travelify theme. I have had some alignment issues which I cannot resolve properly as I have zero previous experience of writing/editing code.

First I noticed that on all my images in my posts the caption text aligned left on the site despite it being centred when editing the posts. After some fumbling around on forums, I added the following piece of code shown in italics:

.wp-caption .wp-caption-text,.gallery-caption {
font-style: italic;
text-align: center;

That fixed the issue for my media image posts, however it also centred the caption on my jetpack image widget in the right sidebar when I would like that text to be left aligned and justified. I have searched in vain for a fix to this and was wondering if any of you could please help?

If you can, that would be very much appreciated.



Try adding this to Theme Options - Other - Custom CSS and let me know if that works

#secondary .wp-caption .wp-caption-text {
    text-align: justify;

Great stuff Aigars, that worked perfectly. Many thanks.