WordPress.org

Ready to get started?Download WordPress

Forums

before and after for wp_list_cats() (9 posts)

  1. BrianBaker
    Member
    Posted 8 years ago #

    When I want to list all my categories on an archive page they always display in a list or as a list. With list set to false it auto inserts
    tags after each so it's still list like. I'd like for wp_list_cats() to have a before and after parameters like wp_get_archives and no auto
    tags so that I can have all the categories in a paragraph separated by commas.

  2. jwurster
    Member
    Posted 8 years ago #

    I would do a search first in the codex to find out how to use these functions.

  3. BrianBaker
    Member
    Posted 8 years ago #

    I have searched, and looked at all the category functions. Perhaps I'm just missing something, but I would like to display the categories in paragraph form like so:

    Category 1, Category 2, Category 3, Category 4

  4. Beel
    Member
    Posted 8 years ago #

  5. BrianBaker
    Member
    Posted 8 years ago #

    I have. With list=0 it inserts tags after each. If I'm missing something I'd love to have it pointed out, but I don't see a parameter for what I want.

  6. Beel
    Member
    Posted 8 years ago #

    inserts tags after each

    I assume you mean break tags? If that is the case, just leave it as a list and in the css set the list to display inline.

  7. BrianBaker
    Member
    Posted 8 years ago #

    Good point. Thanks. I think my <br /> tags got cut when I edited my posts.

  8. Ment0r
    Member
    Posted 8 years ago #

    hi all. i kinda need the same..

    This post is ment to be a suggestion for upcoming versions.

    i need to extend the li-elements with an ID= for my supercool javascript i'm planning to bring into the wordpress world (hehe) :)

    We, as developers, should be able to have BEFORE / AFTER on all ouput-returning-functions, and just get the really plain unformatted data returned from the builtin functions.

    i kinda feel limited actually but otoh havin alot plans for my next theme. But.. i cant make them become reality without start hacking WP itself.

    Sure, i could just stfu and start hacking as much as i need (hell, its open source), but i would like to share my work after some time.

    i think the common list functions (all output functions) need to be extended. As for older-themes compatibility make li-element default, while making it possible to edited them.

    pages output actually is
    <li id=page_item><a href=..>Some page</a></li>

    why? .. i would prefer output like,:
    <a href=..>Some page</a>

    and be able to make function calls like
    list_pages('before="&raquo;&nbsp;"', '<br />');

    I know i could recreate all this by CSS, but if i need to know each element of a list i need to give them IDs. Furthermore, most of the time i need to css-mod basic HTML elements like ol,li,ul just to get a plain link list w/o indents.

    thats not smart in my opinion. if wordpress would like to grow it must become more flexible in the future (with these particular functions). hardcoded design elements are a strict no-no.

    btw.. some plugin coders also really should check a) validation and b) never put fixed styles into their source..

    regards, m3nt0r.

  9. Chionsas
    Member
    Posted 7 years ago #

    Use filters.
    http://codex.wordpress.org/Filters
    There's a filter hook "list_cats".
    You can make your own 'functions.php' (which is auto-included), like the default theme does.

Topic Closed

This topic has been closed to new replies.

About this Topic