Home › Forums › General Issues › Using unique ID/Slug in template › Reply To: Using unique ID/Slug in template
Thanks, John. That makes sense, but I guess I’m getting confused by the language since it’s: if have custom_query posts, while have custom_query posts, the posts, and if in array, and if in array while have rows, the rows, else…
<!--- Accordion Expander - OWL Shortcode Test - NOT WORKING --->
<?php if (in_array("program-administrator", $cats) || in_array("program-manager", $cats)) { ?>
<div class="clearBoth">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<?php $uniqueid = uniqid('collapser'); $count = 0;
while ( have_rows( 'collapser' ) ) : the_row(); ?>
<div class="panel panel-default listbox">
<div class="panel-heading" role="tab" id="headingTwo">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse-<?php echo esc_attr( $uniqueid ); ?>-<?php echo esc_attr( $count ); ?>" aria-expanded="false">
<?php the_sub_field( 'expand_row') ?>
</a>
</div>
<div id="collapse-<?php echo esc_attr( $uniqueid ); ?>-<?php echo esc_attr( $count ); ?>" class="panel-collapse collapse" role="tabpanel">
<div class="panel-body">
<?php if (get_sub_field('description')) { ?>
<div class="panel-text"><b>More info</b><?php the_sub_field('description'); ?></div>
<?php } ?>
<?php if (get_sub_field('education')) { ?>
<div class="panel-text"><b>Education</b><?php the_sub_field('education'); ?></div>
<?php } ?>
<?php if (get_sub_field('expertise')) { ?>
<div class="panel-text"><b>Expertise</b><?php the_sub_field('expertise'); ?></div>
<?php } ?>
<?php if (get_sub_field('experience')) { ?>
<div class="panel-text"><b>Experience</b><?php the_sub_field('experience'); ?></div>
<?php } ?>
<?php if (get_sub_field('research')) { ?>
<div class="panel-text"><b>Research Interests</b><?php the_sub_field('research'); ?></div>
<?php } ?>
<?php if (get_sub_field('publications')) { ?>
<div class="panel-text"><b>Publications</b><?php the_sub_field('publications'); ?></div>
<?php } ?>
<?php if (get_sub_field('bio')) { ?>
<div class="panel-text"><b>Bio</b><?php the_sub_field('bio'); ?></div>
<?php } ?>
</div>
</div>
</div>
<?php $count ++; ?>
<?php endwhile; ?>
<?php reset_rows(); ?>
</div>
</div>
<?php } ?>
What am I missing? Still getting my chops in PHP, so I’m not quite there yet! Any ideas?
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.