@dsouzaj86 @nicmare, can you provide a little insight on my template?
while I can very see the logic you propose (great kudos to you), I’m a little lost on how to apply it to the type of template I need.
Basically, I need this type of markup output
<div id="demoTab">
<ul class="resp-tabs-list">
<li> Tab 1 </li>
<li> .... </li>
<li> .... </li>
</ul>
<div class="resp-tabs-container">
<div> tab content with <InnerBlocks /></div>
<div> ....... </div>
<div> ....... </div>
</div>
</div>
and it escapes me how to obtain it without repeaters.
Do you think it’s possible in the first place? Can you help me shed some light?
thanks in advance,
Alessio
Solved!
Given the filter added in the functions.php file, I had to edit
'compare' => '='
to
'compare' => 'LIKE'
it now works perfectly! Hope this helps others.
Alessio
I think I’m having exactly the same problem as @fredjs, (just a bit simpler, I’d dare to say), yet still did not manage to succeed. I have just posted my question here.
Would you take a look and give advice?
Appreciate, @jonathan! keep up the great work
Alessio
Hi @james,
thank you! you definitely put me on the right track here.
I have achieved the desired result, and also managed to unecho unwanted groups here.
I’ll mark this as solved, post my code below in case it might help others, and kindly ask you to review my code in case you think there could be smarter ways to get to the same point:
<?php
$groups = acf_get_field_groups(array('post_id' => get_the_ID()));
foreach( $groups as $group_key => $group ) {
$fields = acf_get_fields($group);
// below starts condition to unecho unwanted field groups
if($group['title'] !== 'pagelicks'){
echo '<h2>'.$group['title'].'</h2>';
echo '<dl class="techspecs">';
if($fields ) {
foreach( $fields as $field_name => $field ){
$value = get_field($field['name']);
if( $value && $field['label'] !=='Bollicine' && $field['label'] !=='tipologia prodotto' ) {
echo '<dt>' . $field['label'] . '</dt>';
echo '<dd>' . $value. '</dd>';
}
}
echo '<dl>';
}
// below ends condition to unecho unwanted field groups
}
}
?>
Your help was priceless, thanks again!
Alessio
John,
this is PERFECT.
Thanks a bunch,
Alessio
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’re hard at work on ACF 6.1, and Beta 1 is now available 🚀
— Advanced Custom Fields (@wp_acf) March 16, 2023
This release includes custom post type and taxonomy registration, an improved experience when selecting field types, PHP 8.1 and 8.2 compatibility, and more!
Let’s take a look 🧵https://t.co/Y0WcAT11l4
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.