Skip Navigation

[Resolved] Displaying Titles or Captions in Gallery

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 1.70 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 2 replies, has 2 voices.

Last updated by aaronT 4 years, 7 months ago.

Assisted by: Nigel.

Author
Posts
#1343609

I got some code from support that I had put in my theme functions.php file. I forgot that I hadn't used a child theme. When I updated the code went away. I looked back at my support tickets and found the code. Even though I have added a child theme, I found out I can put code in toolset custom code. I have put code there. I then put code in my content template for my gallery. The title is not under the image, it is on the side, Can you help?

What is the link to your site?

To see one of the galleries, go to oceanwalk on menu, and it is on that page.

Thanks,
Aaron
Note: You can look at the ticket for caption on Gallery to see history.

#1343839

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2019-09-19 at 10.46.08.png

Hi there

The issue has nothing to do with the custom code you added to register a custom shortcode.

I did notice one problem. Look at the screenshot. You should be able to see from the code highlighter that something is broken, namely the red closing types shortcode.

That's because the output="raw" attribute is added with double quotes, breaking the url attribute of your show_file_info custom shortcode.

I changed that to use single quotes.

It doesn't fix the issue of the alignment of the captions, though.

That's because you don't have any CSS rules to make the captions appear below the images.

You have an anchor tag containing the image, followed by the text of the caption.

The anchor tag is an inline element, i.e. it doesn't force a new line, unlike a block-level element such as a div or a p tag.

And the text of the caption isn't inside it's own block level container such as a p tag either.

Hence the image and text are displayed inline together.

You need to add CSS to make the a tag a block level element, or you need to update the markup in your template so that you surround the custom shortcode in a block level element such as a div or p tag.

That would bring the text underneath the image. You may still need to tweak paddings or margins, to your taste.

#1344483

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.