File: /var/www/linde/wp-content/themes/linde/single-linde_faq.php
<?php
/**
* The Template for displaying all single posts
*
* Methods for TimberHelper can be found in the /lib sub-directory
*
* @package WordPress
* @subpackage Timber
* @since Timber 0.1
*/
$context = Timber::context();
$timber_post = Timber::get_post();
$context['post'] = $timber_post;
$context['files'] = [];
$current_post_id = $timber_post->ID;
if (have_rows('file_upload', $current_post_id)) {
while (have_rows('file_upload', $current_post_id)) {
the_row();
$file = get_sub_field('select_file');
$file_url = isset($file['url']) ? $file['url'] : '';
$file_name = get_sub_field('file_name');
if(!$file_name){
$file_name = isset($file['filename']) ? $file['filename'] : '';
}
$context["files"][] = array(
'file_url' => $file_url,
'file_name' => $file_name,
);
}
}
Timber::render( array('single-linde_faq.twig' ), $context );