How to display all blog categories and all of the categories' posts?

  • Hi,


    I am wanting to display all my blog categories including all of the posts in each category. I cannot find the code to do this.


    I am only able to display all categories using:


    PHP
    1. <?php
    2. perch_blog_categories(array(
    3. 'template' => 'category_link.html',
    4. ));
    5. ?>


    And I am also able to display all posts using:


    PHP
    1. <?php perch_blog_custom(array(
    2.     'count' => 10,
    3.     'template' =>
    4.     'post_in_list.html',
    5.     'sort' => 'postDateTime',
    6.     'sort-order' => 'DESC',
    7.     ));
    8. ?>


    But what I am wanting to achieve is something like this on my blog page:


    Fitness Category

    - Fitness post 1

    - Fitness post 2

    - Fitness post 3


    Weight Loss Category

    - Weight Loss post 1

    - Weight Loss post 2

    - Weight Loss post 3


    I am using a workaround but it is not ideal. In my blog.php I am currently using:



    So I am basically hardcoding the category titles but I would need a dynamic solution. Would anyone know how to achieve this? Thanks

  • Gareth S

    Approved the thread.