Saltar navegación

[Resuelto] Re-ordering Image field(allow multiple instances) not working

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

Este tema contiene 2 respuestas, tiene 1 mensaje.

Última actualización por Minesh hace 2 semanas, 1 día.

Asistido por: Minesh.

Autor
Mensajes
#2807472

I have an image field which allows multiple instances. I am using the images in a Beaver Builder slider module. It works fine, but when I re-order the fields(drag and drop) in the cpt backend it does not reflect the re-oreding on the front-end. I have cleared he cache so that's not the issue.

enlace oculto

Tim

#2807488

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share admin access details and let me check what's going wrong with your setup.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.

#2807499

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Toolset has limited integration with Beaver builder plugin but not Beaver Themer.

Here is the best practices to use beaver builder with Toolset:
=> https://toolset.com/documentation/user-guides/using-toolset-with-beaver-builder/best-practices-creating-templates-beaver-builder/

You can check rather check with Beaver Builder support to know how you can display the repeating image field from Toolset with the specified order and see if they have any hooks to offer and you are welcome to share that information here so that it may help other users.

#2807897

So I think what I need to do is create a shortcode that outputs the image IDs, then I can use that shortcode in the slideshow module. I tried the solutions in this thread but it's not working:

https://toolset.com/forums/topic/outputting-a-list-of-ids-for-repeating-gallery-image-custom-field-in-custom-post/

Btw, there are many support tickets with basically this same request, that I can find when I search google but almost all lead to 404 page.

Tim

#2807905

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Those tickets are archived as the resolution will be outdated or not working or tickets is too old.

#2807989

The one I linked to is not archived, but the code there is not working either. So how can I output the image IDs of an image field with multiple instances?

#2807990

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

I can help you to build a shortcode that returns the image ids and you can take over from there.

But when I checked the admin access details is not working at this end.

Can you please send me working admin access details.

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

#2808003

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

I've added the following code to "Custom Code" section offered by Toolset with the code snippet namely "toolet-custom-code":
=> enlace oculto

function get_image_id( $atts ) {
global $wpdb;

// Attributes
$atts = shortcode_atts(
array(
'field' => '',
'id' => ''
),
$atts
);

$image_urls = get_post_meta($atts['id'],"wpcf-".$atts['field']);
$id_list = array();
foreach ($image_urls as $image_url) {
if(!empty($image_url)){
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ));
array_push($id_list, $attachment[0]);
}
}

return implode(",", $id_list);

}
add_shortcode( 'get_image_id', 'get_image_id' );

And called the shortcode as given under and added that to your Beaver Builder template at top:
=> enlace oculto

[get_image_id field="image-gallery" id="[wpv-post-id]"]

I can see the above shortcode does return the image ids at top of the page - just after header:
- enlace oculto

You can use the above shortcode as required and do you see it working as expected.