Home › Forums › Add-ons › Repeater Field › Problem with Custom Fields
Hello guys,
I have a problem in some subcategories , using Custom Fields:
I have an Accordion with 3 areas , each area has a sublevel that is the specialty , and specialty contains links to videos.
I need to click on the area the accordion open specialties and specialties to list all posts with the same Custom Field .
What is happening is that for each different link it recreates the specialty , ie if you have 10 links with the Specialty Thorax it shows 10 sub-levels and not just a sublevel ‘ Thorax ‘ with 10 links .
Follows the code , and I hope someone can help me:
`
<!– section –>
<?
$post_type = ‘videos’;
$tax = ‘videos-categories’;
$tax_terms = get_terms($tax);
if ($tax_terms) {
foreach ($tax_terms as $tax_term)
{
$args=array(
‘post_type’ => $post_type,
“$tax” => $tax_term->slug,
‘post_status’ => ‘publish’,
‘order’ => ‘ASC’,
‘posts_per_page’ => -1,
‘caller_get_posts’=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo ‘<h2 class=”acc_title_bar”>‘. $tax_term->name .’ ‘.$result.’</h2>’;
echo ‘<div class=”acc_container”>’;
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class=”block”>
<h2 class=”acc_title_bar”><?php echo get_field(“subEspecialidade”) ?></h2>
<div class=”acc_container”>
<div class=”block”>
<h3>
.mp4″ rel=”lightbox” data-lightbox-type=”iframe”>
<? echo get_field(“codVideo”); ?> – <? the_title(); ?>
</h3>
</div>
</div>
</div>
<?php
endwhile;
echo ‘</div>’;
}
wp_reset_query();
}
}
?>’
Hi @cadoomunhoz
Could you please open a new ticket here: https://support.advancedcustomfields.com/new-ticket? In the new ticket, could you please provide temporary admin credentials so we can check the setup and the issue directly? Don’t forget to explain the issue again and provide the URL where it appears.
Thanks!
The topic ‘Problem with Custom Fields’ is closed to new replies.
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.