• I have (so far) been unable to find anything in the codex or the forums which indicates whether or not there is a (native) way to get the count of the number of links in any particular link category.

    I’m trying to dynamically modify my sidebar menu structure based upon the number of links in a particular category, but I have’t found a way to get the count yet.

Viewing 1 replies (of 1 total)
  • Sorry, it’s not native. You can make a plugin or a hack to do this. Make a copy of the last function, get_links_list(), from wp-includes/links.php and give the new function a unique name. You’ll need to rewrite the MySQL query to accommodate something like ORDER BY count(link_id). This might require the use of GROUP BY instead of DISTINCT, which would break the test for empty categories.
    I’d work out the query for you but I don’t have access to my databases from behind the proxy at work. I should cut out of here…

Viewing 1 replies (of 1 total)
  • The topic ‘Count of links in a specific link category’ is closed to new replies.