W4 Post List
[resolved] Group by Post Category (8 posts)

  1. ChWebP
    Posted 1 year ago #

    Great plugin! Is it possible to group by post category? (My list is alphabetical. It would be great to group by each letter. It would be even better to have each group collapsed showing just the letter, and you click to expand to see all the posts that start with that letter.)


  2. Shazzad Hossain Khan
    Plugin Author

    Posted 1 year ago #

    It should be fairly easy to create a Category + Post list , where category are sorted alphabetically. To do this -

    1. Go to List creation page.
    2. Select "List Type" = Category + Post
    3. Click on "Terms" Tab
    4. Set "Taxonomy" to "Category", "Orderby" to "Name", Order to "ASC", "Items per page" to -1
    5. Click on "Posts" Tab
    6. Set "Post Type" to "Post", "Post Status" to "Publish", "Orderby" to "Title", "Order" to "ASC".
    7. Click on "Template" Tab. Use this there -

      <li><a href="[term_link]" class="my_cat_link" data-toggle="#cpl_[term_id]">[term_name]</a>
      <ol class="my_post_list" id="cpl_[term_id]">
        <li><a href="[post_permalink]">[post_title]</a></li>

    8. Click on "Style" Tab. Use this there -

          $( $(this).data('toggle') ).toggle();
          return false;

    9. Save the list. Copy the Shortcode and use it on Page, Post or Widget Area.

    Thanks for using the plugin.

  3. ChWebP
    Posted 1 year ago #

    Thanks for your fast and helpful support!
    Can this be done also for grouping by post name?

  4. Shazzad Hossain Khan
    Plugin Author

    Posted 1 year ago #

    Please post a review here :)

    And there's no option for Group By Post name, and logically how could that be, is there multiple post with same name ?

  5. ChWebP
    Posted 1 year ago #

    So, the idea would be...



    Where Ace, Apple, etc are the post titles. They would be grouped by the first letter in the post title, so the long list is visually easy to navigate.

  6. Shazzad Hossain Khan
    Plugin Author

    Posted 1 year ago #

    Well, this is can be achieved.

    1. Install this plugin - Custom Post Type UI
    2. Register a Custom Taxonomy for Post (name it "Alphabet")
    3. Insert Some Terms (A,B,C,D) for that taxonomy.
    4. Then Chose appropriate taxonomy for each of the post. There's a bulk edit function which could be useful.
    5. Then create a new Post List - Category + Post
    6. On "Terms" tab - Select the newly created taxonomy (whatever you named it, maybe "Alphabet")
    7. Then follow the steps i posted earlier. (http://wordpress.org/support/topic/group-by-post-category?replies=5#post-5700427)
    8. On "Template" tab, remove the line -
    <a href="[term_link]" class="my_cat_link" data-toggle="#cpl_[term_id]">[term_name]</a> - (this is because you wont need to display the taxonomies)
    9. "Style" tab could be empty, as there's no show/hide mechanism.

    ** Taxonomy == Group (ex: Continent)
    ** Terms == Group Element (ex: Africa)

    Cheers :)

  7. ChWebP
    Posted 1 year ago #

    Thanks! Where is step 3 completed? I can't find anything labeled "Terms" in the new plugin "Edit Custom Post Type or Taxonomy" section.

  8. Shazzad Hossain Khan
    Plugin Author

    Posted 1 year ago #

    I am not sure what they have named, Probably "Custom Taxonomies" or "CPT". And your won't find terms there. Lets assume you have created the CPT named "Alphabet". Then, you would see it under the Posts menu, below "Categories", "Tags".

    Hope it helps.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W4 Post List
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic