Skip Navigation

[Resuelto] View slider of repeater field imagen and video of taxonomy

This support ticket is created hace 1 año, 2 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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 17 respuestas, tiene 3 mensajes.

Última actualización por Minesh hace 1 año, 1 mes.

Asistido por: Minesh.

Autor
Mensajes
#2647889

Minesh
Supporter

Idiomas: Inglés (English )

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

I've adjusted the code added to "Custom Code" section as given under:

function func_add_video_to_slider( $atts ) {
	
		$i=0;
		// Attributes
		$atts = shortcode_atts(
								array(
								'slug' => '',
								),
								$atts
								);
	

 	
	$term_meta = types_render_termmeta('video-category',array('output'=>'raw','separator'=>","));
	$term_meta = explode(",",$term_meta);
	$str = '';
	foreach($term_meta as $k=>$v):
  
  	if(!empty($v)) {
      
	 $i = $i+1;
	 $unique_slug = 'player_'.$atts['slug']."_".$i;
	 $str = $str.'<li>';	
	 $str = $str.'<iframe id="'.$unique_slug.'" src="'.$v.'?rel=0&player_id='.$unique_slug.'" width="100%" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
     $str = $str.'</li>';
	
   }
	endforeach;
	
	 
return $str;
 
}
 add_shortcode( 'add_video_to_slider', 'func_add_video_to_slider' );

Can you please confirm it works as expected now:
- enlace oculto

#2647929

Now it is no longer displayed, thanks.
What is the meaning of the variables $k=>$v? is to give it a more descriptive name.

#2647931

Minesh
Supporter

Idiomas: Inglés (English )

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

$k means key and $v means value.

You can change it as required and glad to know that solution I shared help you to resolve your issue. You're welcome to mark resolve this ticket.