'post', 'posts_per_page' => 6, ); $posts = new WP_Query($args); $formatted_posts = array(); if ($posts->have_posts()) { while ($posts->have_posts()) { $posts->the_post(); $formatted_post = array( 'title' => get_the_title(), 'link' => get_permalink(), 'excerpt' => get_the_excerpt(), 'thumbnail' => has_post_thumbnail() ? get_the_post_thumbnail_url(get_the_ID(), 'full') : get_template_directory_uri() . "/static/front-page/img/blog_card-img.jpg" ); $formatted_posts[] = $formatted_post; } wp_reset_postdata(); } return $formatted_posts; } $context = Timber::get_context(); $context['slider'] = get_field('slider'); $context['about_title'] = get_field('about_title'); $context['about_desc'] = get_field('about_desc'); $context['about_img'] = get_field('about_img'); $context['about_img_m'] = get_field('about_img_m'); $context['about_list'] = get_field('about_list'); $context['about_comp_text'] = get_field('about_comp_text'); $context['about_comp_logo'] = get_field('about_comp_logo'); $context['about_rev'] = get_field('about_rev'); $context['reviews_repeater'] = get_field('reviews_repeater'); $context['blog_posts'] = get_blog_posts_data(); $context['about_rev_title'] = get_field('about_rev_title'); $context['q_title'] = get_field('q_title'); $context['reviews_title'] = get_field('reviews_title'); $context['q_1'] = get_field('q_1'); $context['q_2'] = get_field('q_2'); $context['q_3'] = get_field('q_3'); $context['q_4'] = get_field('q_4'); $context['q_5'] = get_field('q_5'); $context['promo'] = get_field('promo'); $context['promo_text'] = get_field('promo_text'); $context['show_about'] = get_field('about_show'); $context['show_promo'] = get_field('promo_show'); $context['show_rev'] = get_field('vet_show'); $context['show_q'] = get_field('quiz_show'); $context['show_blog'] = get_field('blog_show'); $context['reviews'] = get_field('reviews'); $context['sub_title'] = get_field('sub_title'); $context['sub_text'] = get_field('sub_text'); Timber::render('front-page.twig', $context); ?>