WordPress.org

Ready to get started?Download WordPress

Forums

How to show list_categories not as a list (5 posts)

  1. vostok
    Member
    Posted 5 years ago #

    Hello,

    I've been searching the forum and the codex, but no luck. I'm sorry if I've overlooked something.

    How can I get the list_categories to be in a row, and not a list? For an example: Category 1, Category 2, Category 3 etc.

    Any help would be much appreciated.

  2. chaoskaizer
    Member
    Posted 5 years ago #

    try

    <?php
     echo strtr(wp_list_categories("echo=0&title_li=''&style=none"),array('<br />'=>''));
    ?>
  3. livelearncreate
    Member
    Posted 5 years ago #

    Thanks, this worked really well. I'm actually looking to use it with commas. Any advice or tricks on how to strip the last comma from the list?
    So I don't have a hanging commas at the end?

    This is what I'm using.

    <?php echo strtr(wp_list_categories("&child_of=5&style=none&echo=0"),array('<br />'=>', '));?>

    This is what I get now:
    Features, Shorts, Interviews,
    Columns, Links,

  4. airbrushtour
    Member
    Posted 5 years ago #

    How do I create a custom order for list-categories? orderby doesn't work at all. It still outputs according to id number. What if I want to output like this:

    <?php wp_list_categories('orderby=7,1,4,5,6,9,33&include=7,1,4,5,6,9,33&exclude=10&title_li=' . __('The Category List')); ?>

    As it is, it outputs as: 1,4,5,6,7,9,33, but I want it to output like this:

    7,1,4,5,6,9,33 - NOT 10

    Any suggestions?

  5. t31os
    Member
    Posted 5 years ago #

    No need to post in multiple threads airbrush, you won't get a faster reply, the thread you created is sufficient...

Topic Closed

This topic has been closed to new replies.

About this Topic