WordPress.org

Forums

Display list of categories with their description (8 posts)

  1. Nuuk
    Member
    Posted 3 years ago #

    Hi Everyone,

    As the topic title says, I'm trying to display a list of categories with their description.

    I'm currently using:
    <?php wp_list_categories('child_of=1&title_li='); ?>

    But I'd like to display their descriptions as well.

    How would one go about doing this?

    Thanks in advance!

  2. keesiemeijer
    moderator
    Posted 3 years ago #

  3. Nuuk
    Member
    Posted 3 years ago #

    Yes exactly thanks. So I'm currently using this piece of code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    How do I strip it down to only displaying the child themes of for example id=4

  4. Nuuk
    Member
    Posted 3 years ago #

    And another thing, how do I display the categories horizontal.. Can you even do that with get categories..

  5. keesiemeijer
    moderator
    Posted 3 years ago #

    change this:

    $categories = get_categories();

    to:

    $categories = get_categories(child_of=4);

    And another thing, how do I display the categories horizontal

    And the descriptions also horizontal?

  6. Nuuk
    Member
    Posted 3 years ago #

    Thanks, that doesn't work though. Cant load the site if I change it to (child_of=4), it definitely screws with something..

    Yeah I want to display the categories and their descriptions like this: http://cl.ly/0c2J3U3T2T2W3j1B3F0v

  7. keesiemeijer
    moderator
    Posted 3 years ago #

    sorry, this:

    $categories = get_categories('child_of=4');
  8. Nuuk
    Member
    Posted 3 years ago #

    Ah, great. Thank you very much. Do you have any idea how I can accomplish the layout I linked, http://cl.ly/0c2J3U3T2T2W3j1B3F0v.

Topic Closed

This topic has been closed to new replies.

About this Topic