• I would like to show a “current tab” in my categories list, which I use for the main nav of my site http://skebrown.com. I am working on this from the article ALA: Sliding Dooors of CSS. http://www.alistapart.com/articles/slidingdoors/

    • Category 1
    • <li id="current">Category 2

    • Category 3
    • Here is what I am using as my main nav:
      <ul id="catnav">
      <?php wp_list_cats('sort_column=name'); ? >

      How do I get the id=”current” properly into the category list for the active category?
      I understand that if I could get the below example into the

    • tags, my worries would be over. However, I am stumped since the

    • and categories are coming from the db?

      <li<?php if ($thisPage=="Page One")
      echo " id=\"currentpage\""; ?>>
      Page One

      <li<?php if ($thisPage=="Page Two")
      echo " id=\"currentpage\""; ?>>
      Page Two

      <li<?php if ($thisPage=="Page Three")
      echo " id=\"currentpage\""; ?>>
      Page Three

      <li<?php if ($thisPage=="Page Four")
      echo " id=\"currentpage\""; ?>>
      Page Four


    Any help would be appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The file wp-admin/menu.php has code for this. Unfortunately, it does not get the categories from the database. You must modify the admin code to use the query from list_cat() in wp-includes/template-functions-category.php:
    $query = “
    SELECT cat_ID, cat_name, category_nicename, category_description, category_parent
    FROM $tablecategories
    WHERE cat_ID > 0 $exclusions
    ORDER BY $sort_column $sort_order”;
    $categories = $wpdb->get_results($query);

    Thread Starter skebrown

    (@skebrown)

    Thanks for the post. I will give it a try and let you know?
    Kind regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CSS: Current State in Categories List’ is closed to new replies.