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 Restaurant Menu Flip Cards Widget

By Common Ninja

Restaurant Menu Flip CardsTry 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

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing 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

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership 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

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics 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.

Restaurant Menu Flip Cards for Wordpress logo

Restaurant Menu Flip Cards

Present dishes with restaurant menu flip cards that highlight key details, help visitors explore options easily, and support confident ordering decisions.

FAQ for Wordpress logo

FAQ

Add an FAQ section to your site to answer common questions, reduce support requests, and give visitors a smoother and more confident user experience.

Countdown to Download for Wordpress logo

Countdown to Download

Use a countdown to download widget that reveals files after the timer ends, builds anticipation, and guides visitors toward higher engagement.

Coupon Bar for Wordpress logo

Coupon Bar

Display discounts with a coupon bar that highlights special offers, drives urgency, and helps convert visitors into paying customers.

Animated Number Counter for Wordpress logo

Animated Number Counter

Show key stats with an animated number counter that draws attention, adds social proof, and helps increase trust and conversions.

Scores Board for Wordpress logo

Scores Board

Show rankings and performance data on your site with a customizable scores board that motivates participation and keeps users engaged.

Age Gate for Wordpress logo

Age Gate

Use an age verification popup to validate visitor age, meet regulatory requirements, and ensure only eligible users access restricted content.

Tilted Image for Wordpress logo

Tilted Image

Use tilted image effects to rotate visuals, add creative style, and keep visitors engaged with dynamic images on your site.

Corner Coupon Pop-up for Wordpress logo

Corner Coupon Pop-up

Add a corner coupon pop-up to highlight discounts, collect emails, and drive user engagement without interrupting browsing.

Video Carousel for Wordpress logo

Video Carousel

Showcase videos with a video carousel that rotates or slides clips, improves visual design, and keeps visitors watching and engaged.

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.

Job Listings for Wordpress logo

Job Listings

Create job listings with a jobs board widget that lets you post openings, manage roles easily, and help candidates find the right positions quickly.

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