// Acción AJAX para usuarios autenticados y no autenticados
add_action('wp_ajax_obtener_repeater_files', 'obtener_repeater_files_callback');
add_action('wp_ajax_nopriv_obtener_repeater_files', 'obtener_repeater_files_callback');
function obtener_repeater_files_callback() {
// Verificar si hay filas en el repeater de ACF
if (have_rows('tu_nombre_repeater')) {
echo '
'; // Contenedor de lista de archivos
// Recorrer las filas del repeater
while (have_rows('collection-files')) {
the_row();
// Obtener el campo tipo archivo
$archivo = get_sub_field('files');
// Si el campo tiene contenido, generar el enlace
if ($archivo) {
$url = esc_url($archivo['url']); // URL del archivo
$nombre = esc_html($archivo['title']); // Nombre del archivo
echo "
'; // Cerrar la lista
} else {
// Mensaje si no hay filas en el repeater
echo 'No hay archivos disponibles.';
}
wp_die(); // Finalizar la llamada AJAX
}
add_shortcode('mostrar_archivos_repeater', function() {
ob_start(); // Inicia el almacenamiento en búfer
if (have_rows('collection-files')) { // Cambia 'tu_nombre_repeater' por el nombre real de tu repeater
echo '
';
while (have_rows('collection-files')) {
the_row();
$archivo = get_sub_field('files'); // Cambia 'tu_nombre_field_file' por el nombre del campo de archivo
if ($archivo) {
$url = $archivo['url'];
$titulo = $archivo['title'];
// Muestra el enlace
echo '
';
}
return ob_get_clean(); // Devuelve el contenido almacenado en el búfer
});
Skip to content
Inter-American Institute for Cooperation on Agriculture
News
“Producing specialty coffee is more than a job; it’s a passion”
A young man from Honduras runs a family farm whose coffee is leading an online auction that will be held on August 12 with support from PROCAGICA, a program implemented by the European Union and IICA.
Syngenta and IICA join forces to foster agricultural innovation in the Americas
Headquartered in Switzerland, Syngenta is a global leader in the research and development of products to protect crops and improve seeds. The company and IICA will work together to implement projects aimed at expanding farmers’ access to tools that foster sustainable agricultural production.
Region on the alert for possible new Covid-free sanitary barriers to international food trade
Concern was expressed by production sector representatives in an international seminar organized by IICA and GPS, in collaboration with CIARA-CEC and other agricultural and trade promotion organizations.
The 2020 World Food Prize winner appeals for sustainable soil management to boost agricultural productivity
During an online conversation with Manuel Otero, Director General of IICA, renowned scientist and Nobel Prize winner, Rattan Lal, emphasized the importance of soil health in creating a more efficient and environmentally friendly agriculture sector.
Taiwan ICDF and IICA strengthen cooperation to boost agriculture in Saint Lucia and other countries in the Caribbean
IICA and the ICDF Taiwan Technical Mission in Saint Lucia sign an agreement to foster greater collaboration on areas of common priority including commercial composting and enhancing institutional mechanisms for improved management of the agri-food supply chain in Saint Lucia and the Eastern Caribbean States.
IICA helps to spread awareness on flood preparation and response in the agriculture sector in Trinidad and Tobago
This forms part of an ongoing technical cooperation support provided by IICA to the Ministry of Agriculture, Land and Fisheries in building capacity for agriculture risk management and disaster response.
Eight South American singers and musical groups join the IICA tribute to food chain workers
Approximately 100 artists and musical groups have now come on board the IICA initiative to turn the political and social spotlight on the agriculture sector and rurality during Covid-19.