The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Need to list subcategories while using isotope in wordpress

  • # November 28, 2012 at 11:16 am

    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

    <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>
    'orderby' => 'name',
    'order' => 'ASC'
    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="< ?php echo $cat->slug; ?>">
    < ?php $cat = get_categories('child_of='); ?>
    <?php } ?>
    # November 28, 2012 at 12:08 pm

    You might want to try instead of doing a custom category loop trying 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).

    # November 28, 2012 at 1:10 pm

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

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed