Forums

lost in a sea of taxonomies, terms and slugs (1 post)

  1. scorcho
    Member
    Posted 1 year ago #

    So here's my problem.

    I based my site off the Whiteboard framework, which is much simplified from TwentyTen - http://whiteboardframework.com/

    • I created a custom post type - 'Collection'
    • two taxonomies - 'Modern' and 'Traditional'
    • a host of terms/tags within each - i.e. 'Shirt' 'Pants' 'Hat'
    • a host of posts identified by these terms
    • and created both a single-collection and taxonomy.php page in my theme directory to show these goods.

    on both the taxonomy.php and single-collection.php templates i've been able to set up a sidebar vertical menu that shows a hierarchical list as such -

    Traditional
    - term 1
    - term 2
    - term 3

    Modern
    - term 1
    - term 2
    - term 3

    using this code -

    <?php if ( ! dynamic_sidebar( 'Collection' ) ) : ?><?php endif ?>
    <h3 style="color:#c2eef1">Traditional</h3>
    <?php wp_tag_cloud( array( 'taxonomy' => 'traditional', format => 'list' ) ); ?>
    <h3>Modern</h3>
    <?php wp_tag_cloud( array( 'taxonomy' => 'modern', format => 'list' ) ); ?>
    </ul>

    How would I go about passing an 'active' class to the parent tag/term? Say for instance I'm viewing an entry titled 'Jeans', which is tagged with 'Pants'. How would I enable this in that page's menu?

    Traditional
    - term 1
    - <li class="active">pants
    - term 3
    Consequently, when viewing a list of all posts in 'Pants', how do i show that as the active class?

    Thanks in advance for any help!

Topic Closed

This topic has been closed to new replies.

About this Topic