Im totally new to Twig and Timber. I was reading their doc and watch some tutorials however I cannot get it to work.
I have this WP Query with custom post type and ACF field:
<?php $ args = array( 'post_type' => 'what_our_clients_say', 'posts_per_page' => 2 ); $ loop = new WP_Query( $ args ); while ( $ loop->have_posts() ) : $ loop->the_post(); echo '<div class="what-our-client-say-single-wrapper p-relative aos-init aos-animate" data-aos="fade-up" data-aos-delay="100">'; echo '<div class="what-our-client-say-single-wrapper-violet"></div>'; echo '<div class="what-our-client-say-inner-wrapper p-relative">'; echo '<div class="what-our-client-say-inner-wrapper-img"><img src="' . get_field('what_our_clients_img') . '" class="img-client img-fluid"></div>'; echo '<div class="what-our-client-say-inner-wrapper-all-txt"><div class="what-our-client-say-inner-wrapper-header"><h3>'.get_the_title().'</h3></div>'; echo '<div class="what-our-client-say-inner-wrapper-txt"><p>'. get_the_excerpt() .'</p></div><div class="what-our-client-say-inner-wrapper-who"><p>'. get_field("what_our_clients_say_who") .'</p></div>'; echo '</div></div><a href="https://pragmaticbrains.com/case-study" target="_blank" class="button big primary-colorbg no-hover what-our-client-say-special-btn">READ MORE'; echo '</a>'; echo '</div>'; endwhile; wp_reset_postdata(); ?>
And when I pass it to php file it works. However when I try to make it work in .twig file it doesn”t. My main problem is not with fields or excerpt / title parts (which I convert to: {{ post.title }} but with this loop:
$ args = array( 'post_type' => 'what_our_clients_say', 'posts_per_page' => 2 ); $ loop = new WP_Query( $ args ); while ( $ loop->have_posts() ) : $ loop->the_post(); (...) endwhile; wp_reset_postdata();
part. I would be very grateful for your help