Skip Navigation

[Resolved] How to grab the IDs of an image field with multiple instances?

This support ticket is created 5 years, 2 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 21 replies, has 2 voices.

Last updated by peterZ 5 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1542471

Shane
Supporter

Languages: English (English )

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

Hi Peter,

Do you need my help constructing this new shortcode ?

Please let me know.

Thanks,
Shane

#1543371

I'd appreciate it very much! Thank you!

#1544475

Shane
Supporter

Languages: English (English )

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

Hi Peter,

Try this code.

// Add Shortcode
function cust_masonry( $atts ) {

	// Attributes
	$atts = shortcode_atts(
		array(
			'_builder_version' => '4.3.4',
			'images' => '',
			'hover_enabled' => '0',
		),
		$atts
	);

	return do_shortcode("dss_masonry_gallery _builder_version='".$atts['_builder_version']."'images='".$atts['images']."'hover_enabled='".$atts['hover_enabled']."']");

}
add_shortcode( 'cust_masonry', 'cust_masonry' );

Just pass the custom shortcode i've sent previously into the image parameter of this shortcode and let me know if it helps.

The format is [cust_masonry images="[custom_shortocde]"]

Please let me know if this helps.
Thanks,
Shane

#1544695

Hi Shane,

sorry, I dont understand the logic you used as this would again lead to nested shortcodes.

I created a shortcode that should work from the Post ID alone but I can't get it to work. Support login still exists. Could you check on it?
Thank you!

#1544919

Shane
Supporter

Languages: English (English )

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

Hi Peter,

It seems the issue is that you added my code incorrectly to your site.

The masonry should be working as intended.

Please check on your end and let me know if everything is OK now.
Thanks,
Shane

#1547735

My issue is resolved now. Thank you!

#1550661

Hi Shane,
there is an error with this code.
For some reason it doesn't pick up more than 5-6 images.