Previously Shane you had this working well https://toolset.com/forums/topic/outputting-a-list-of-ids-for-repeating-gallery-image-custom-field-in-custom-post/ but it has stopped working and for the life of me I can't figure out why. Can you assist again? Maybe some upgrade in WordPress broke it???
Hello,
I have checked the thread you mentioned above:
https://toolset.com/forums/topic/outputting-a-list-of-ids-for-repeating-gallery-image-custom-field-in-custom-post/#post-1712783
The credentials was removed, but I can get the your website URL:
hidden link
It seems to work fine, see my screenshot image-gallary.JPG
Is this problem resolved?
Since it is a custom codes problem, if you need more assistance for it, please provide your website credentials in below private message box, also point out the problem page URL and where I can edit your PHP codes.
Thanks for reviewing. Please request log in credentials so that I can provide. The thumbnails on the screen was my back up method. There should be a slider appearing above them that shows 6 images and then left and right arrows to see additional images, this is no longer working for some reason.
Hello,
Please provide your website credentials in below private message box, also point out the problem page URL and where I can edit your PHP codes.
Private message box enabled again
Thanks for the details, the problem is in your [gallery] shortcode, I have tried it directly in your website page:
hidden link
<p>gallery:</p>
<br />
[gallery columns='6' ess_grid_gal='project-thumbnail-slider' ids='356,357,358,359,360,361,362' orderby='rand']
It does not output any result in front-end:
hidden link
I suggest you try to fix the [gallery] shortcode first.
And I have tried it without attribute "ess_grid_gal", it works fine in front-end, for example:
[gallery columns='6' ids='356,357,358,359,360,361,362' orderby='rand']
Ok, I want to try another way. I found this video on create a toolset slider from dynamic image field to make a slider but it's all done in block builder. hidden link
How do I do this using the non-block builder. I'm using Toolset Layouts for the CPT single page.
So I cloned my site and then created a new temporary content template to use blocks to build a slider that I wanted and the selected the HTML version and brought that back to the live production site. Here's the code I was able to generate:
<div class="tb-image-slider" data-toolset-blocks-image-slider="1">
<div class="tb-image-slider--carousel tb-image-slider--crop glide" data-glide-number-slides="6" data-glide-tablet-breakpoint="781" data-glide-tablet-number-slides="4" data-glide-phone-breakpoint="599" data-glide-phone-number-slides="2">
<div class="glide__arrows" data-glide-el="controls"><button class="glide__arrow glide__arrow--left" data-glide-dir="<"><span class="tb-slider-left-arrow"></span></button><button class="glide__arrow glide__arrow--right" data-glide-dir=">"><span class="tb-slider-right-arrow"></span></button></div>
<div class="glide__track" data-glide-el="track">
<ul class="glide__slides">[wpv-for-each field="wpcf-gallery-image"]</p>
<li class="glide__slide"><a href="[types field='gallery-image' output='raw'][/types]" data-lightbox="8311e904-b0b4-46d6-bf01-f9f827a274f9">[types field='gallery-image' alt='%%ALT%%'][/types]</a></li>
<p>[/wpv-for-each]</ul>
</div>
</div>
</div>
This works well except, I can't see to force the code to display "thumbnail" size images instead of full images just downsized for the thumbnails and I didn't see a way to change the size of the thumbnails. I'm fudging it somewhat with this CSS:
.tb-image-slider--crop .glide__slide img {
-o-object-fit: cover;
object-fit: cover;
height: 200px !important;
width: 100%!important;
}
Surely there is a better way to do this in a site not built with Blocks but with classic editor.
In the codes you mentioned above, it is using below shortcode to display the image:
[types field='gallery-image' alt='%%ALT%%'][/types]
You can add "size" attribute in it, for example:
[types field='gallery-image' alt='%%ALT%%' size='thumbnail'][/types]
And test again.
More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#image
size:
custom image size | 'full' | 'large' | 'medium' | 'thumbnail'
My issue is resolved now. Thank you!