Forums

How To Replace Subcategories With Posts in Sidebar? (5 posts)

  1. mojobobo
    Member
    Posted 4 years ago #

    I've been searching for hours now to solve this. The idea is pretty simple but I can't find out how to do it.

    Categories:

    Cat 1
    - Subcat 1
    - Subcat 2
    Cat 2
    - Subcat 1
    - Subcat 2

    Instead of displaying subcategories in the sidebar I want to display the posts of that category. So it would turn out like:

    Cat 1
    - Post 1
    - Post 2
    Cat 2
    - Post 1
    - Post 2

    It would be great if you could hide all the posts until you actually click the main category.

    Thanks.

  2. Kafkaesqui
    Moderator
    Posted 4 years ago #

  3. mojobobo
    Member
    Posted 4 years ago #

    Great, thanks a lot!

    Some small quirk fixing and it works very well.

    term_id should be cat_ID. According to the plugins I use.

  4. Kafkaesqui
    Moderator
    Posted 4 years ago #

    Sorry.

    term_id >= 2.3.x

    cat_ID <= 2.2.x

  5. hussainbtk
    Member
    Posted 3 years ago #

    well done Kafkaesqui, that's code works 100%, but i have a question..

    how to show the category like this:
    Category
    --Subcategory
    Category
    --Subcategory
    Category
    --Subcategory

    not like this

    Category
    Subcategory
    Category
    Subcategory
    Category
    Subcategory

    your code is 100% working but it shows the main and the sub category mix, i want to separate the sub category with this " --- "

    Please help me i am really confused!!!

Topic Closed

This topic has been closed to new replies.

About this Topic