I am trying to create a custom image slider using visual composers attach_images but cant quite work out how to get the URLs from the array of image IDs. Any help would be appreciated.
var_dump($bg_images) returns string(9) "19,6,1692"
vc_map( array(
"name" => __( "Fading Background Block", "farrat_vc" ),
"base" => "block_background",
"class" => "",
"category" => __( "Farrat Shortcodes", "farrat_vc"),
"as_parent" => array('except' => 'farrat_panel'), // Use only|except attributes to limit child shortcodes (separate multiple values with comma)
"content_element" => true,
"show_settings_on_create" => true,
"is_container" => true,
'admin_enqueue_css' => array(get_template_directory_uri().'/wp-content/themes/unite/inc/css/gallery.css'),
"params" => array(
array(
"type" => "attach_images",
"heading" => __( "Backgroud Images", "farrat_vc" ),
"param_name" => "bg_images",
),
),
"js_view" => 'VcColumnView'
) );
I got a neet workaround for this one on the loop, theres no need for the counter, loop over
wp_get_attachment_image( $image_id, 'full' );
will get you every information u use on the wordpress panel.I'll thank to @sushovan bhowmik was looking for this, I think this will help to avoid lots of variables calling the images :)