Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Need to list subcategories while using isotope in wordpress

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #41047
    chrisdasie
    Member

    Hi I’m using isotope to navigate a client site I’m working on. I’ve gotten the parent categories to list and do what they are suppose to do but the subcategories aren’t displaying. Any help would be greatly appreciated.

    An example of what I’m trying to achieve can be found here http://ifactory.ca/dev/sensei_grid/

    <dl class="accordion" id="filter" data-option-key="filter">
    <dt><h2><a href="#" data-filter="*" id="showall" class="selected about-senseitop close-subnav filter-item">All</a></h2></dt>
    <?php
    $args=array(
    'orderby' => 'name',
    'order' => 'ASC'
    );
    $categories=get_categories($args);
    foreach ($categories as $cat) { ?>
    <dt><a href="#" class="customer-acquisitiontop" id="<?php echo $cat->slug; ?>" data-filter=".<?php echo $cat->slug; ?>"><h2><?= $cat->cat_name; ?></h2></a></dt>
    <dd class="services">
    <ul class="row">
    <li class="slug; ?>">

    </li>
    </ul>
    </dd>
    <?php } ?>
    </dl>
    #115814
    Chris Coyier
    Keymaster

    You might want to try instead of doing a custom category loop trying wp_list_categories (http://codex.wordpress.org/Template_Tags/wp_list_categories) and seeing if that gives you the right stuff (and maybe you can just work with that markup).

    Otherwise you’ll need to dig into what $categories is turning out to be and adjust your loop to output the right stuff. It’s probably very close, just some syntax issues (I’m not quite sure).

    #115827
    chrisdasie
    Member

    Thanks Chris I’ll give those options a try. Greatly appreciated.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Back End’ is closed to new topics and replies.