Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- attempt static iteration -->
- <div id="accordion">
- <h3><a href="#">First header</a></h3>
- <div>Content 1 default as collapsed</div>
- <h3><a href="#">Second header</a></h3>
- <div>Content 2 default as collapsed</div>
- </div>
- <!-- method 1 -->
- <div id="accordion">
- <?php
- $args=array(
- 'orderby' => 'name',
- 'order' => 'ASC',
- 'hide_empty' => FALSE, //important or will not display at all since some cats may have no posts
- 'child_of' => 4,
- 'display' => 'linear'
- );
- $categories=get_categories($args);
- foreach($categories as $category) {
- echo ' <a href="#">' . $category->name.'</a>';
- }
- ?>
- <!-- method 2 -->
- <?php $categories = get_categories('hide_empty=0&orderby=name&title_li=&child_of=4'); foreach ($categories as $cat) { ?>
- <dt><a href="#"<?php if ($cat->slug == 'photos') {?> class="customer-acquisitiontop" <?php } else {?>class="customer-acquisitiontop" <?php }?>id="<?php echo $cat->slug; ?>" data-filter=".<?php echo $cat->slug; ?>"><h2><?= $cat->cat_name; ?></h2></a></dt>
- <dd class=" ">
- <ul class="row">
- <li class="<?php echo $cat->slug; ?>">
- </li>
- </ul>
- </dd>
- <?php
- }
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement