wordpress query_posts with foundation 6 Accordion not working correctly

It looks like your code is adding a new <ul> for every post. What you really want is a single <ul> wrapped around all of the posts.

Query_posts is also frowned on because it alters the main query. You could use get_posts instead, and add a variable $i to determine whether you’re on the first post or not. If you are, add the is-active class.

Try:

<?php
$myposts = get_posts(array(
'post_type' => 'customposttypename',
'taxonomyname' => 'taxonomyslug',
'posts_per_page' => -1
));
if(count($myposts) > 0) {
?><ul class="accordion" data-accordion><?php
for($i=0; $i<count($myposts); $i++) {
setup_postdata($myposts[$i]);
?><li class="accordion-item<?php if($i==0) { echo ' is-active'; } ?>" data-accordion-item>
<a href="#" class="accordion-title"><?php echo $myposts[$i]->post_name; ?></a>
<div class="accordion-content" data-tab-content>
<?php echo $myposts[$i]->post_content; ?>
</div>
</li><?php
}
?></ul><?php
} ?>

//added and _