Home › Forums › ACF PRO › Using get_template_part in acf › Reply To: Using get_template_part in acf
I’m using ACF 5 but this solution doesn’t work for me:
get_teplate_part('parts/content', get_sub_field('tipo_blocco'));
tipo_blocco is a select field that if i put into the page i can see:
echo get_sub_field('tipo_blocco');
I’ve also tried to put the filed into a variable like this:
$tipo_blocco = get_sub_field('tipo_blocco');
get_teplate_part('parts/content', $tipo_blocco));
Where is the mistake?
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.