The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Different way of displaying sub-categories? (4 posts)

  1. Kasmus
    Posted 11 years ago #

    Hi WordPressers!
    Is there a way of displaying sub-categories in the format category:sub-category?
    Since I'm using many sub-categories to organize my posts and I always have to additionally select the category of the respective sub-category in order to get it displayed in the sidebar, it's quite confusing to have the category displayed seperately under each post.
    Have a look at http://projektor.bundespest.de/ and you'll understand... :D

  2. Dirk
    Posted 11 years ago #

    Can you clarify? Your posts seem to be in several categories.

  3. Kasmus
    Posted 11 years ago #

    Sure, let's simply have an example:
    The post Pongmechanik ist lited in the following categories:
    As you can see Kultur and Technikzeug both are subcategories.
    Now I want WP to display them below the posting in a way that makes the hierarchy clear.
    WP currently simply displays the selected categories & subcategories in alphabetical order. For the example above this is:
    Kategorie: Technikzeug, Netz, Kultur, Gadgets
    I would prefer this way:
    Kategorie: Technikzeug: Gadgets, Netz: Kultur
    Is there any way to do this?

  4. DennisWilliamson
    Posted 11 years ago #

    Correction: A space is added after the separator string in the output of the function. So calling the_category(',') would display "Category1, Category2, Category3". The space is hard-coded and can't be over-ridden.
    See this entry in the Wiki for a replacement function which allows more flexibility in the use of separators and fixes the single/multiple bug (which has been fixed in the development version on the CVS).

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.