ThemeShaper Forums » Thematic

adding a class to the #subsidiary div

(1 post)
  • Started 10 years ago by Krusty Ruffle
  • This topic is not a support question
  1. I hope this posts to the right place, if not I apologize.

    I wanted to add a class to this div so that I could target the subsidiary asides diferently depending how on how many were active. Here's what I did:

    open up sidebar-subsidiary.php, goto line 4 which looks like: <div id="subsidiary"> and change it by copy pasing the following over it:

    $sub_count = 0;

    if ( is_sidebar_active('1st-subsidiary-aside'))
    $sub_count ++;
    if ( is_sidebar_active('2nd-subsidiary-aside'))
    $sub_count ++;
    if ( is_sidebar_active('3rd-subsidiary-aside'))
    $sub_count ++;

    <div id="subsidiary" class="subs-<?php echo $sub_count; ?>">

    There may be a better way, but this works so I thought I'd share it. I'm currently using it to adjust the width on the sub-aside divs depending on how many there are.

    Thanks for reading :)

    Posted 10 years ago #

RSS feed for this topic


You must log in to post.