Support » Themes and Templates » categories and parents for a total noob

  • Hi folks
    I’m new to WP and I’m currently playing with customising etc. I’m stuck on something at the moment though, so I thought I’d ask here.

    My category is currently looking something like this;

    Parent name
    > cat a
    > cat b
    > cat c
    > cat d
    Parent name
    > cat a
    > cat b
    > cat c
    > cat d
    Parent name
    > cat a
    > cat b
    Parent name
    > cat a
    > cat b
    > cat c

    (The > is a triangle gif graphic)

    My first problem is that the triangle appears 2 times in each cat group eg:

    Parent name
    > cat a
    > > cat b
    > cat c
    > cat d
    Parent name
    > cat a
    > > cat b
    > cat c
    > cat d
    Parent name
    > > cat a
    > cat b
    Parent name
    > cat a
    >
    > cat b
    > cat c
    The last one apprears between cat a and cat b.

    My next problem is that I want to format my parents in a different colour, bold etc. The code in my sidebar.php file is this:
    <div class=”left”>
    <div class=”sub_left”>
    <div class=”left_header”>Categories</div><br style=”line-height:15px “/>

      <?php wp_list_cats(‘sort_column=name& hide_empty=0’); ?>

    <br style=”line-height:25px “/>
    <div class=”left_header”>Archive</div><br style=”line-height:15px “/>

      <?php get_archives(‘monthly’,’10’,’custom’,’

    • ‘,’
    • ‘); ?>

    <br style=”line-height:30px “/>
    <?php
    $link_cats = $wpdb->get_results(“SELECT cat_id, cat_name FROM $wpdb->linkcategories”);
    foreach ($link_cats as $link_cat) {
    ?>
    <div class=”left_header”><?php echo $link_cat->cat_name; ?></div><br style=”line-height:15px “/>

      <?php get_links($link_cat->cat_id, ‘

    • ‘, ‘
    • ‘, ‘
      ‘, FALSE, ‘id’, TRUE,
      TRUE, -1, TRUE); ?>

    <br style=”line-height:25px “/>
    <?php } ?>
    <div class=”left_header”>Meta</div><br style=”line-height:15px “/>

    </div>
    </div>

    I can’t really see how I can create a css tag and insert it to format the parent text. Any suggestions how I can do this?

    My final problem is that my category parents aren’t in the order i want them. How can I specificy the order of parents in the list?

    Sorry for the long post and thanks for any help you can offer.
    Is this actually a good place to be asking basic questions or is there a community for the “not so knowlegable”?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter buggerlugs

    (@buggerlugs)

    no one can help?

    I usually avoid looking at code that isn’t “between backticks” because it’s inaccurate. And when there’s no link to observe the behavior firsthand it leaves a lot of chances for misunderstandings…

    One thing pops out right away though: The br tag isn’t allowed to have child elements.

    Thread Starter buggerlugs

    (@buggerlugs)

    ok i will try “backticks” – sorry if i get it wrong as it isnt very clear. You say put code between “these” and below it says put code between these
    So applologies if this is wrong but here is my sidebar code after changing the <br> tags


    <div class="left">
    <div class="sub_left">
    <div class="left_header"><strong>Categories</strong></div><br>
    <ul>
    <?php wp_list_cats('sort_column=name&optioncount=0&hierarchical=1&children=1&hide_empty=0'); ?>
    </ul><br>
    <div class="left_header"><strong>Archive</strong></div><br>
    <ul>
    <?php get_archives('monthly','10','custom','<li>','</li>'); ?>
    </ul><br>
    <?php
    $link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
    foreach ($link_cats as $link_cat) {
    ?>
    <div class="left_header"><strong><?php echo $link_cat->cat_name; ?></strong></div><br>
    <ul>
    <?php get_links($link_cat->cat_id, '<li>', '</li>', '<br />', FALSE, 'id', TRUE,
    TRUE, -1, TRUE); ?>
    </ul><br>
    <?php } ?>
    <div class="left_header"><strong>Meta</strong></div><br style="line-height:15px "/>
    <ul>
    <?php wp_register('<li>', '</li>'); ?>
    <li><?php wp_loginout(); ?></li>
    <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
    <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    <li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
    <?php wp_meta(); ?>
    </ul>
    </div>
    </div>

    The problem with the triangles is still there

    http://www.electricvenus.com

    what i am after is to make the parents a different colour and bold and also to remove the extra triangles that have appeared

    Thread Starter buggerlugs

    (@buggerlugs)

    bumping 🙁

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘categories and parents for a total noob’ is closed to new replies.