• Hello
    I was wondering if anyone would know how to dynamically insert an id value into a category list. For instance, I am pulling the children of a category dynamically from WP, when someone clicks on the link and is brought to the sub-section, I would like the list item to be highlighted.
    Something like:

      • Main Category
      • Child Category

      When someone clicks on Child Category, I want it to look like:

      • Main Category
        <li id="current">Child Category


      Is there a way to set this up in WordPress so that it will automagically insert id=”current” whenever a sub-category is clicked on?
      Thanks in advance and any help is appreciated

    Viewing 2 replies - 1 through 2 (of 2 total)
    • Hello,
      I am having the same problem, been looking around, can’t find a way. I notice www.remarpro.com uses “id=” in their menus, so does www.remarpro.com use WP for their site? Or do they make the menus by hand, or is there a hack?
      ANy help would be appreciated.
      Thanks in advance,
      Plebian.

      I too am looking into a similar function. So far I have found a way to get all the ID’s associated with the post you are currently looking at. But I’m not sure how to get all the categories associated with the current category. You might be able to do it with a huge list of if statements ie:

      if this is cat 1 — then show cat 2,4,6,16
      else if…

      Seems to crazy to do that though.

    Viewing 2 replies - 1 through 2 (of 2 total)
    • The topic ‘Inserting id=” ” dynamically’ is closed to new replies.