Collapsing Categories

Collapsing Categories

Wordpress plugin

Install on Wordpress

App Details

Collapsing Categories creates an expandable list of categories and
subcategories. It can also expand to show posts. The primary usage is as a
widget, but you can also use the code in your theme manually if you wish (see
installation instructions)

Options

Options can be set
from the block panel. If you wish to insert the code into your theme manually
instead of using a widget, you can use the following options. These options
can be given to the collapsCat() function either as an array or in query
style, in the same manner as the wp_list_categories function.

$defaults=array( 'showPostCount' => true, 'inExclude' => 'exclude', 'inExcludeCats' => '', 'showPosts' => true, 'showPages' => false, 'linkToCat' => true, 'olderThan' => 0, 'excludeAll' => '0', 'catSortOrder' => 'ASC', 'catSort' => 'catName', 'postSortOrder' => 'ASC', 'postSort' => 'postTitle', 'expand' => '0', 'defaultExpand' => '', 'postTitleLength' => 0, 'accordion' => 0, 'catfeed' => 'none', 'taxonomy' => 'category', 'showPostDate' => false, 'postDateAppend' => 'after', 'postDateFormat' => 'm/d', 'useCookies' => true, 'showTopLevel' => true, 'postsBeforeCats' => false, 'expandCatPost' => true, 'debug'=>'0' ); 
  • inExclude
    • Whether to include or exclude certain categories
      • ‘exclude’ (default)
      • ‘include’
  • inExcludeCats
    • The categories which should be included or excluded
  • showPages
    • Whether or not to include pages as well as posts. Default if false
  • linkToCat
    • 1 (true), clicking on a category title will link to the category archive (default)
    • 0 (false), clicking on a category title expands and collapses
  • catSort
    • How to sort the categorys. Possible values:
      • ‘catName’ the title of the category (default)
      • ‘catId’ the Id of the category
      • ‘catSlug’ the url of the category
      • ‘catCount’ the number of posts in the category
      • ‘catOrder’ custom order specified in the categorys settings
  • catSortOrder
    • Whether categories should be sorted in normal or reverse
      order. Possible values:
      • ‘ASC’ normal order (a-z 0-9) (default)
      • ‘DESC’ reverse order (z-a 9-0)
  • postSort
    • How to sort the posts. Possible values:
      • ‘postDate’ the date of the post (default)
      • ‘postId’ the Id of the post
      • ‘postTitle’ the title of the post
      • ‘postComment’ the number of comments on the post
      • ‘postOrder’ sort by menu order
  • postSortOrder
    • Whether post should be sorted in normal or reverse
      order. Possible values:
      • ‘ASC’ normal order (a-z 0-9) (default)
      • ‘DESC’ reverse order (z-a 9-0)
  • expand
    • The symbols to be used to mark expanding and collapsing. Possible values:
      • ‘0’ Triangles (default)
      • ‘1’ + –
      • ‘2’ [+] [-]
      • ‘3’ images (you can upload your own if you wish)
      • ‘4’ custom symbols
  • customExpand
    • If you have selected ‘4’ for the expand option, this character will be
      used to mark expandable link categories
  • customCollapse
    • If you have selected ‘4’ for the expand option, this character will be
      used to mark collapsible link categories
  • postTitleLength
    • Truncate post titles to this number of characters (default: 0 = don’t
      truncate)
  • accordion
    • When set to true, expanding one category closes all others at that level
  • catfeed
    • Whether to add a link to the rss feed for a category. Possible values:
      • ‘none’ (default)
      • ‘text’ shows RSS
      • ‘image’ shows an RSS icon
  • taxonomy
    • Type of taxonmy to display. Possible values:
      • ‘category’ (default)
      • ‘link_category’
      • ‘post_tag’
      • ‘both’ (categories and tags)
      • any other registered taxononmy (e.g. recipe press uses recipe-categories)
  • showPostDate
    • When true, show the date of each post
  • postDateAppend
    • Show the date before or after the post title. Possible values:
      • ‘after’ (default)
      • ‘before’
  • postDateFormat
    • What format the post date is in. This uses the standard php date
      formatting codes
  • useCookies
    • When true, expanding and collapsing of categories is remembered for each
      visitor. When false, categories are always display collapsed (unless
      explicitly set to auto-expand). Possible values:
      • 1 (true) (default)
      • 0 (false)
  • showTopLevel
    • When set to false, the top level category will not be shown. This could
      be useful if you only want to show subcategories from one particular
      top-level category
      • 1 (true) (default)
      • 0 (false)
  • postsBeforeCats
    • When set to true, posts in category X will be ordered before
      subcategories of category X
      • 1 (true)
      • 0 (false) (default)
  • expandCatPost
    • When set to true, any category to which a post is assigned will
      automatically be expanded on a single post page.
      • 1 (true) (default)
      • 0 (false)
  • showEmptyCat
    • When set to true, empty categories are shown
      • 0 (false) (default)
      • 1 (true)
  • debug
    • When set to true, extra debugging information will be displayed in the
      underlying code of your page (but not visible from the browser). Use
      this option if you are having problems

Examples

collapsCat('catSort=ASC&expand=3&inExcludeCats=general,uncategorized') 

This will produce a list with:
* categories shown in alphabetical order
* using images to mark collapsing and expanding
* exclude posts from the categories general and uncategorized

` 

<?php
echo '

    ‘ . “\n”;
    if (function_exists(‘collapsCat’)) {
    collapsCat(array(
    ‘postSort’ => ‘postDate’,
    ‘postSortOrder’ => ‘DESC’,
    ) );
    } else {
    wp_get_categories(‘your_options_here’);
    }
    echo “

\n”;
?>
`

Demo

I use this plugin in my blog at http://robfelty.com

CAVEAT

Currently this plugin relies on Javascript to expand and collapse the links.
If a user’s browser doesn’t support javascript they won’t see the links to the
posts, but the links to the categories will still work (which is the default
behavior in wordpress anyways)

Pricing

Starting from $0 per month.

Check Out the eBay Reviews Widget

By Common Ninja

eBay ReviewsTry For Free!

App Info

Rating

Reviewers

56 reviews

Tags

categories
navigation
sidebar
widget

Developed By

robfelty

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Maps

Maps plugins for Wordpress

Translation

Translation plugins for Wordpress

Chat

Chat plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Contact

Contact plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Forms

Forms plugins for Wordpress

Comments

Comments plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Comments

Comments plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Video Player

Video Player plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Security

Security plugins for Wordpress

Ads

Ads plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Membership

Membership plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

eBay Reviews for Wordpress logo

eBay Reviews

Show eBay reviews to build trust, strengthen credibility, and help visitors make confident purchase decisions that support higher sales.

Vimeo Carousel for Wordpress logo

Vimeo Carousel

Show Vimeo videos with a Vimeo carousel that displays clips in a smooth, flexible layout to boost visibility and engagement.

X Feed for Wordpress logo

X Feed

Show posts in an X feed that keeps updates visible, improves content discovery, and helps visitors stay engaged with your latest activity.

Feedback Popup for Wordpress logo

Feedback Popup

Collect user insights with a feedback popup that reveals issues early, improves user experience, and captures valuable leads through a clear feedback form.

Tabs for Wordpress logo

Tabs

Use tabs to organize content into clear sections, improve navigation, and help visitors switch between topics quickly for a smoother user experience.

Tumblr Feed for Wordpress logo

Tumblr Feed

Show Tumblr posts with a Tumblr feed that keeps content fresh, improves navigation, and helps visitors discover more posts.

Threads Feed for Wordpress logo

Threads Feed

Show Threads posts in a live feed that keeps content fresh, builds social proof, and helps visitors engage on your site.

Collapsible Content for Wordpress logo

Collapsible Content

Use Collapsible Content sections to structure information on your site and make it easier for visitors to find what they need.

Instagram Feed for Wordpress logo

Instagram Feed

Show Instagram posts in a live feed that keeps content fresh, builds social proof, and helps visitors engage with your brand.

Instagram Carousel for Wordpress logo

Instagram Carousel

Show Instagram posts in a responsive carousel layout to enhance social proof and keep your site content visually fresh.

All In One Chat for Wordpress logo

All In One Chat

Add a unified chat tool to your site that connects users via WhatsApp, Messenger, Telegram, or email for seamless support.

Pricing Tables for Wordpress logo

Pricing Tables

Add pricing tables to your site to present plans clearly, help visitors compare features, and guide them toward faster and more confident conversions.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms