Accordion Shortcodes

Wordpress Plugin
Download latest - 2.4.2

Developers

philbuchanan

Download Stats

Today 39
Yesterday 66
Last Week 339
All Time 161,258


Accordion Shortcodes is a simple plugin that adds a few shortcodes for adding accordion drop-downs to your pages.

The accordions should blend seamlessly with your theme. However, you may want to edit your theme's main stylesheet in order to add some custom styling (see below for sample CSS).

Features

  • Adds two shortcodes for adding accordions to your site
  • Supports multiple accordions with individual settings on a single page
  • Two buttons in the TinyMCE editor make it easy to add and configure the accordion shortcodes
  • Responsive
  • No default CSS added
  • Only adds JavaScript on pages that use the shortcodes
  • Support for item IDs and direct links
  • Accessible (for users requiring tabbed keyboard navigation control)

Optional Features

  • Open the first accordion item by default
  • Open all accordion items by default
  • Disable auto closing of accordion items
  • Manually close items by clicking the title again
  • Scroll page to title when it's clicked open
  • Set the HTML tag for the title element
  • Change the semantic structure of your accordions (advanced)

The Shortcodes

The two shortcodes that are added are:

[accordion]...[/accordion]

and

[accordion-item title=""]...[/accordion-item]

Basic Usage Example

[accordion] [accordion-item title="Title of accordion item"]Drop-down content goes here.[/accordion-item] [accordion-item title="Second accordion item"]Drop-down content goes here.[/accordion-item] [/accordion]

This will output the following HTML:

Title of accordion item

Drop-down content goes here.

Second accordion item

Drop-down content goes here.

Releases (28 )

Version Release Date Change Log
2.4.2 2019-03-29
  • FIXED: Each accordion group now respects its own settings when using multiple accordions on a single page
2.4.1 2019-03-19
  • FIXED: Accordions now open onkeyup instead of onkeydown to better comply with WCAG 2.1 accessibility guidelines
2.4.0 2019-03-12
  • NEW: Added option to add a button tag wrapper around the accordion title
  • FIXED: better accessibility support
  • Now compatible up to WordPress 5.1
2.3.3 2017-05-28
  • Now compatible up to WordPress 4.8
  • FIXED: aria-mutliselectable is now on the accordion group instead of each accordion item title
2.3.2 2016-12-22
  • Now compatible up to WordPress 4.7
  • FIXED: Accordion titles now truly accessible via keyboard control
2.3.1 2016-11-03
  • Now compatible up to WordPress 4.6
  • FIXED: A bug with a deprecated function in jQuery
2.3.0 2016-04-09
  • NEW: Added setting to set initial state (open or closed) of individual accordion items on page load
  • NEW: Added wp-config option to disable the TinyMCE extension
  • Now compatible up to WordPress 4.5
2.2.6 2016-01-10
  • FIXED: Scroll offset was ignored when an accordion was linked to from another page
2.2.5 2015-12-17
  • Now compatible up to WordPress 4.4
2.2.4 2015-08-18
  • Now compatible up to WordPress 4.3
2.2.3 2015-05-20

FIXED: A bug where the content editor would break in custom post types.

2.2.2 2015-05-20
2.2.1 2015-05-13

FIXED: A bug where setting both scroll and openfirst would scroll the window without user interaction.

2.2 2015-05-03
  • NEW: Accessible for users requiring tabbed keyboard navigation control (this took way too long)
  • NEW: A classname of 'read' is now added to accordion item titles as they are opened. This allows you to style all read accordion items.
  • NEW: Compatibility mode adds a prefix to the shortcodes for themes that already include accordion shortcodes with matching names.
  • FIXED: Animation queue not clearing.
  • Now compatible up to WordPress 4.2
2.1.1 2014-12-29
  • FIXED: An issue where openfirst would not work if title tag was set to div
  • FIXED: An issue where title tag setting was not respected when using multiple accordions on one page
2.1 2014-12-19
  • NEW: Use multiple accordions on a single page! Each shortcode will now respect its own individual settings.
  • Now compatible up to WordPress 4.1
2.0.1 2014-09-05
  • NEW: Add a custom CSS classname to your accordion item group or accordion item shortcode
  • NEW: Set an integer for scroll property to offset the scrolling by that many pixels
  • Now compatible up to WordPress 4.0
2.0 2014-08-05
  • NEW: Buttons in the editor to easily add shortcodes with various settings
  • NEW: Support for item IDs on accordion items and direct linking to a specific item
  • NEW: Change the entire semantic structure of your accordions by using definition lists
  • ENHANCED: Class added if JavaScript is disabled (so you can style your accordions differently if necessary)
  • ENHANCED: Each accordion now has its own unique ID (accordion-1, accordion-2...) so you can target each one on a page
  • FIXED: A few incredibly small bugs/annoyances

=

1.3.1 2014-07-02
  • Fixes an issue where an empty tag attribute would break the accordion
  • Tags are now checked against a list of valid HTML tags
1.3 2014-06-05
  • Added global HTML tag setting for accordion item titles
1.2.4 2014-04-21
  • Compatibility with WordPress 3.9
1.2.3 2014-03-14
  • Added the shortcode parameter when calling shortcode_atts()
1.2.2 2014-03-03
  • Added option to scroll page to title when it's clicked open
  • Added detection for SCRIPT_DEBUG to load minified JavaScript conditionally
1.2.1 2014-02-20
  • Added option to open all items by default
1.2 2014-01-24
  • Fixed a potential error with headers already being sent
  • Fixed an issue with the SVN repo
  • Code cleanup
1.1.2 2014-01-23
1.1.1 2014-01-23

Added a link to plugin documentation from the plugins page for easy access.

trunk 2013-12-30