Support » Plugins » Need help with list_cats

  • Is there a way to take this <?php list_cats(0, ‘all’, ‘name’)?> and split it into its constituant parts so that they can be individually wrapped in a tags?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter liquibyte

    (@liquibyte)

    OK, from what I’ve gotten with the above code, each category gets parsed to an individual link by the time it shows up in the browser. What I want to do is be able to take each of those links, no matter if there is one or ten, and put them wherever I want. Basically I had (had, accidently deleted 48 hours work) a menu on the left where all links were enclosed in a ‘display: block;’ I was able to get everything almost laid out right when I discovered that only the first link in the list would get ‘blocked’. I had that thing looking nice too, now I have to start almost from scratch again. Could still use the help though, I have older versions of my css left and I remember most of what I did to the php files.

    Can you give us a more detailed description of what you are trying to accomplish?

    Thread Starter liquibyte

    (@liquibyte)

    This » <?php list_cats(0, ‘all’, ‘name’)?> makes the following:
    Category One
    Category Two
    Category Three
    I want to be able to do this:
    ———————-
    | Category One |
    ———————-
    | Category Two |
    ———————-
    | Category Three |
    ———————-
    I can already do this with my links, but as this code parses on the fly, I need a way to catch it before it gets to the page.

    Thread Starter liquibyte

    (@liquibyte)

    You know, the font in the textarea and the font on the page should be the same size so that we can avoid confusion while trying to draw textual representations of our insanity.

    this can easily be done with CSS. take a look at my blog. if you look at the top nav you will see an Unordered List [UL] out put with:
    <?php list_cats(1,'home','ID','asc','index.php',1,-1,0,1,1) ?>
    I used CSS to control the list. you can do so also. look into it a little more with this site to learn how to tame lists.
    Here is the CSS that used:

    .topmenu {
    background-color: #1B3F7E;
    padding: 3px;
    background-image: url(images/img_130.gif);
    border-top: 1px solid #3C3C3C;
    border-left: 1px solid #3C3C3C;
    border-bottom: 1px solid #B2B2B2;
    border-right: 1px solid #B2B2B2;
    margin: 0px 0px 10px 0px;
    background-attachment: fixed;
    }
    .topmenu ul {
    margin: 0px;
    padding: 0px;
    }
    .topmenu ul li {
    list-style-type: none;
    display: inline;
    margin: 0px;
    padding: 0px;
    border-right: 1px solid #FFFFFF;
    }
    .topmenu ul li.last {
    border-style: none;
    }

    I hacked the “list_cats” function to output the class “last” for the last category listed. if you want that just drop me an email ians at vminc dot net.

    I updated the list_casts function on my website (www.chait.net) to support the sliding-doors button technique. Just download the wp-includes/template-functions.php file and look at it (or whatever that darn file is…).
    Basically, I added the ability to pass in $before and $after instead of them being just locally-defined variables. This way, I can add a span or a div around each of the links.
    However, you could also use #menu ul li { rule } to add borders. Well, more specifically, you’d want to add a div id=’catslist’ or id the ul around the call to list_cats, then do #menu ul .catslist li {rule}. That rule could add a border around each of the sub list elements. Actually, just to confuse you, it is probably:
    #menu ul li .catslist ul li
    Or something like that. You can obviously simplify the rule down to:
    .catslist li
    … most likely (I’m still learning the particular language issues with referential style overloads…).
    In theory, you could do it just adding a unique id to the ul for the cats list. Or you can go way overly complex (like I did) with divs and spans and excess markup… I’m into excess markup! 😉
    =d

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Need help with list_cats’ is closed to new replies.