Skip Navigation

[Resolved] Add source name and image URL for featured images, display caption and source

This thread is resolved. Here is a description of the problem and solution.

Problem:

Featured images do not display caption. We use images from other sources that requires us to provide link to the source. We want to have captions for featured images with text and link to the source being displayed under featured image.

Solution:

It is possible with Toolset Image block of Toolset Blocks plugin.

Relevant Documentation:

https://toolset.com/block-item/image/

This support ticket is created 3 years, 10 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by mashaB 3 years, 9 months ago.

Assisted by: Luo Yang.

Author
Posts
#2107017

Tell us what you are trying to do?
Featured images do not display caption. We use images from other sources that requires us to provide link to the source. We want to have captions for featured images with text and link to the source being displayed under featured image.

Is there any documentation that you are following?
Toolset tutorials about adding custom fields

Is there a similar example that we can see?
This plugin does something similar, but not exactly
https://wordpress.org/plugins/custom-url-to-featured-image/

What is the link to your site?
under development

#2107193
image-caption2.JPG

Hello,

I assume you are going to display post featured image with caption setting:
Link text: current post title
Link to: Current post link

If it is, it is possible with Toolset Image block of Toolset Blocks plugin, see my screenshot image-caption2.JPG

More help:
https://toolset.com/block-item/image/

#2107997
Screenshot 2021-07-06 175015.png

Thanks a lot, Luo Yang!

I still have a couple of things to address:
1. On the actual post featured image is now displayed twice. I see that I can remove it from themes additional css, but I do not want to do it globally. How can I do it for specific post type.
2. The image added via Tootset Image block is not styled as featured image, I would like to keep theme styling for that.
3. I still do not understand how I can add an external URL to the image source in caption area.

The theme we use is Purea Magazine Pro.

Let me probably explain #3 in more details:
Each image should have the following data associated with it:
(a) Caption
(b) Image source name
(c) Image source link

And in the caption area it should display the following text:
Caption Text. Source: image-website.com

#2108083
caption.JPG
css.JPG

Q1) Toolset content template works only in post content area, the extra featured image should from your theme file, you need to find and edit your theme file and remove it, you can check it with your theme author.

Q2) You can find and select the Toolset Image block, in section "Advanced", add a custom CSS class name, see my screenshot css.JPG, then use CSS codes to style it

Q3) You can use Toolset shortcode in the image caption, for example, find and select the Toolset Image block, in section "Caption", option "Caption Source" choose none, then fill Toolset shortcode into the "Caption" box, see my screenshot Caption.JPG

Here are some documents about Toolset shortcodes:
- Shortcodes of Toolset Blocks(Views) plugin:
https://toolset.com/documentation/user-guides/views-shortcodes/

- Shortcodes of Toolset Types plugin:
https://toolset.com/documentation/customizing-sites-using-php/functions/

#2108155

Q1) Resolved by applying this code inside Content Template CSS editor:

/* CSS to hide featured images in single posts */
.single .image {
display: none;
}

Q2) Got it, thx!

Q3) How can I get custom field value via shortcode?

#2108179

If the custom fields are created with Toolset Types plugin, you can use Types shortcode [types ...][/types] to display them, see the document I mentioned above:
https://toolset.com/documentation/customizing-sites-using-php/functions/

If you still need assistance for it, please provide a test site with the same problem, fill below private message box with login details, also point out the problem post URL, I can setup a demo for you

#2112455

My issue is resolved now. Thank you!