Skip Navigation

[Resolved] Simple question. Correct way for an image to have the post title as title

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

Problem:

I am having an issue finding a way to place the title of a post as the title of an image using shortcodes in WordPress.

Solution:

Use the WordPress shortcode within another shortcode to achieve this, such as [types field='image-slug' title='[wpv-post-title]' alt='%%ALT%%' align='center' size='full' ]. For more information, visit WordPress Dashboard > Toolset > Settings or refer to the documentation.

Relevant Documentation:

https://toolset.com/documentation/legacy-features/views-plugin/shortcodes-within-shortcodes/

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.

This topic contains 1 reply, has 2 voices.

Last updated by Christopher Amirian 5 months, 1 week ago.

Assisted by: Christopher Amirian.

Author
Posts
#2702539

Hello, I have a simple question. In the plugin documentation I did not find a way to place the title of the post as the title of an image

Locally I discovered that by placing wordpress shortcode in the image shortcode I get what I was looking for. The result would be something like:

[types field='image-slug' title='[wpv-post-title]' alt='%%ALT%%' align='center' size='full' ]

It works, but I have a bit of doubt about leaving a shortcode inside another shortcode, is it bad practice? Is there another way to insert the post title as an image title?

Thanks greetings

#2702678

Christopher Amirian
Supporter

Languages: English (English )

Hi there,

You used the correct method. Actually, one of the methods that is a string point of Toolset is to use shortcode inside a shortcode attribute.

You can even register your shortcodes in Toolset to be used with Toolset shortcode from WordPress Dashboard > Toolset > Settings

For more information:

https://toolset.com/documentation/legacy-features/views-plugin/shortcodes-within-shortcodes/

Thanks.

#2702734

Thanks for the information, very interesting