Skip Navigation

[Resolved] Tutorial code does not work for me

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

Problem: I tried following the tutorial to create an image gallery, but the HTML is showing up broken on my site.

Solution: Be sure to add HTML markup to your content using the "Text" tab of the editor, not the "Visual" tab.

This support ticket is created 6 years, 1 month 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 2.96 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by lawrenceK 6 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1127021

I am trying to:
Recreate an image gallery as explained in this tutorial: https://toolset.com/2017/10/adding-a-gallery-of-images-for-custom-posts/

Link to a page where the issue can be seen: hidden link

I expected to see: A gallery of images

Instead, I got: html code not properly parsed. Even if I copy the tutorial code and only change the field's slug I get the same results. What am I doing wrong?

#1127070

Hi, it won't look exactly like the tutorial because you're using Divi instead of OceanWP. However, the markup should not be broken and showing link tags as HTML. Most likely there is a nested quotation mark issue or something. I'll be glad to take a look. Please copy + paste any code used in this Divi Builder design - including any shortcodes that are not Toolset-related. Let me know if the builder design is applied directly to the post, or if the design is applied to a Content Template for this post.

#1127072

Hi Christian

Thanks for the reply.

I created the single post design using a content template created with Divi. Here is the code:
[wpv-for-each field="wpcf-product-images"]

[types field='product-images' alt='%%ALT%%' title='%%TITLE%%' width='200' height='200' align='none' resize='crop' separator=', '][/types]

[/wpv-for-each]

I looked for missing closing tags etc but I'm clearly overlooking something. Happy to give you access to the site if needed.

#1127091

Please try this alternate syntax for page builders:

{!{wpv-for-each field="wpcf-product-images"}!}

<a href="{!{types field='product-images' size='full' url='true' separator=','}!}{!{/types}!}">{!{types field='product-images' alt='%%ALT%%' title='%%TITLE%%' width='200' height='200' align='none' resize='crop' separator=', '}!}{!{/types}!}</a>

{!{/wpv-for-each}!}

If that doesn't help, I'll need to take a closer look. Please provide login credentials in the private reply fields here. Also let me know where to find this Content Template.

#1127106
Screen Shot 2018-10-14 at 3.19.25 PM.png

I think you were editing code using the "Visual" tab (see screenshot). That causes problems with HTML markup, so you should switch to the "Text" tab whenever you need to add HTML tags to your content. I made that change and updated the shortcodes to use the corrected syntax. Looks good now, can you confirm?

#1127141

Brilliant thank you Christian. I'll use the text tab from now on to add any HTML or shortcodes. May I suggest that this is added to the tutorial as well to prevent others from wasting your time as I have done?

#1127142

My issue is resolved now. Thank you!