Skip Navigation

[Resolved] adding a shortcode inside an html element

This support ticket is created 5 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 5 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1243580

Tell us what you are trying to do? add a shortcode inside an html element

Here is the html:

<!--Featured image-->
<div class="view overlay rounded z-depth-1">
<img src="hidden link" class="img-fluid" alt="Sample project image">
<a>
<div class="mask rgba-white-slight"></div>

</div>

I am trying to add this shortcode in place of the image url link using this:

[types field='member-image' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types]

but it does not work...

<img src="[types field='member-image' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types]" class="img-fluid" alt="Sample project image">

Is there any documentation that you are following? hidden link

Is there a similar example that we can see? hidden link

What is the link to your site? hidden link

#1243602

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - what if you try to use the following code:

Types image shortcode offers the attribute url='true' that will return you the image URL:

<img src="[types field='member-image' title='%%TITLE%%' alt='%%ALT%%' size='full' url='true'][/types]" class="img-fluid" alt="Sample project image">

More info:
=> https://toolset.com/documentation/customizing-sites-using-php/functions/#image

#1243650
2019-05-14_15-47-12.jpg

Hi Minesh...

I tried this:

<!-- Card image -->
<div class="view overlay">
<img src="[types field='member-image' title='%%TITLE%%' alt='%%ALT%%' size='full' url='true'][/types]" class="img-fluid" alt="Sample project image">
<img class="card-img-top" src="[types field='member-image' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types]" alt="Card image cap">
<a>
<div class="mask rgba-white-slight"></div>

</div>

Image attached.

#1243672

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - it looks like the code is broken in the middle.

Can you please share problem URL and access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1243722

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now. I've adjusted the code as given under:

<img src="[types field='member-image' size='full' url='true'][/types]" class="img-fluid" alt="Sample project image">
    <img class="card-img-top" src="[types field='member-image' url='true' size='full'][/types]" alt="Card image cap">

I can see it's displaying the image:
-=> hidden link