Skip Navigation

[Resolved] Image gallery with lightbox issue

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

Our next available supporter will start replying to tickets in about 8.52 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 12 replies, has 3 voices.

Last updated by Christian Cox 3 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#2035567

Hi Christian,

I managed to solve the translation problem, thank you.

I have second question (you can create another ticket). I find out this: https://toolset.com/forums/topic/is-it-possible-to-use-custom-post-fields-within-a-wordpress-shortcode/
You where been helping about this problem (get image from post with ID). I create everything but not work for me. Pleas can you inpect and suggest me what I doing wrong?

I have 12 field for image to upload (or I must user one image multiple instance field), I put function in snipet, register get_image_ids as 3rd party shortcode argument..but nothing show. I need image ID so I can put shortcode in my gallery element so that I will have image gallery lightbox.

My current solution are very bad.

best regards,
Marko

#2035569

From previous ticket:
-

Just to say I got to display image but very bad, not clicable (on click open lagre image), not in grid and problem with closing bracket in code.
I try to use this: <p>[cz_gallery id="cz_77972" images="[gallery ids="[get_image_ids post_id='[wpv-post-id]']"]"]</p> Not work.

Or this:
[gallery columns="4" link="file" size="medium" ids="[gallery ids="[get_image_ids post_id='[wpv-post-id]']"]"]
Work but on clicable and not in grid.

#2035689

Okay I'm not familiar with the cz_gallery shortcode, what does it expect in the "images" attribute - should it include image IDs, or image URLs, or what format is expected? Can you show me a working example?

#2035699

Hi,

this is working example (url: hidden link) there are 2 different example - media grid from visual composer and
code looks like this: [cz_gallery id="cz_92529" images="460,459,458,461"]

So I need put image id into images""..I put shorcode but " not close and than I have issues.

Do you have some suggestion how to display image in grid and on click open lightebox.

#2035835

Okay if you need this:

 [cz_gallery id="cz_92529" images="460,459,458,461"]

...then you probably do not need extra gallery shortcodes, just the cz_gallery shortcode and the get_image_ids shortcode. Can you place this code in the same location, and share the results?

Test get image ids: [get_image_ids post_id='[wpv-post-id]']<br />
Test in gallery:  [cz_gallery id="cz_92529" images="[get_image_ids post_id='[wpv-post-id]']"]<br />
#2036005

Nothing not show. Can I send you login data so you can login and see?

#2036011

Yes okay I can take a look if you provide login credentials in the private fields here. Let me know where I should look to see the results.

#2036637
Screen Shot 2021-04-29 at 7.26.54 AM.png

In toolset->dashboard you will see template by name: Izgled profila projektana. This is structure of my post that represent for every user his "profil"..
I am not currently able to edit this Content Template with WP Bakery Page Builder:
hidden link

I am attaching a screenshot here showing what I see. The WPBakery builder does not appear here. Do you plan to use WPBakery Page Builder to design this template, or do you plan to use the Classic Editor or the Blocks Editor? If you want to use WPBakery, may I update your Toolset plugins? There was an issue in the previous release that caused problems editing templates with 3rd-party page builders like WPBakery, Avada, and Divi. The latest version of Views includes a fix for this issue, so I believe updating will allow me to edit the template with WPBakery again.

#2037071

Hi,

yes I have that problem (many time refresh and than I see WPBakery elements). Yes you can update plugin 🙂

best regardas,
Marko

#2037263

Okay I cannot get that template to open in the WPBakery designer, no matter what I try. If I switch to the Classic Editor, at least I can see the shortcodes to see how things are set up in your Content Template. The code there looks okay as far as I can tell, the get_image_ids shortcodes seem to be implemented correctly.

So I checked the edits in your custom code snippet here:
hidden link

When using WordPress APIs that interact directly with custom field slugs from the database, please note that these image field slugs should include the wpcf- prefix. Types fields all use a wpcf- slug prefix in the database, so I have changed this code:

 
 $images[] = get_post_meta($postid, 'slika-za-galeriju-1', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-2', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-3', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-44', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-55', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-6', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-7', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-8', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-9', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-10', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-11', true);
 $images[] = get_post_meta($postid, 'slika-za-galeriju-12', true);

Now the code looks like this:

 
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-1', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-2', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-3', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-44', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-55', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-6', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-7', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-8', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-9', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-10', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-11', true);
 $images[] = get_post_meta($postid, 'wpcf-slika-za-galeriju-12', true);

I added the wpcf- prefix to each slug. Now I can see some Image IDs in the page where the get_image_ids shortcodes are placed in your Content Template:
hidden link
I can also see a CZ grid element that opens a lightbox when you click the image. So somethings seem to be working better now, can you take a look?

#2051019

Hi Christian,

thanks a lot, it work great! I have problem with upload image from macbook, no name error just won't upload image to media library. Do you have that kind of problem? I try with iphone and it's work.

best regardas,
M

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/image-upload-problem-from-macbook/

#2051075

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Christian is currently on a public holiday today but he will be back tomorrow to continue assisting you with this one.

What you can do to help when christian is back is to provide a short video demonstration of the upload issue, this way Christian can try to replicate the issue to see what is wrong.

Thank you for the patience and understanding.

#2051781

I have not experienced this issue (I use a macbook pro), but I have split off a separate ticket so we can discuss the problem in more detail.