Want to skyrocket the popularity of your plugin and reach millions of eager users? Look no further than WP Hive. Gain credibility through in-depth reviews, drive conversions with targeted email marketing, and boost visibility with strategic social promotion and exposure
Sorry, pal! The plugin couldn’t pass all our tests. No hard feelings, right?
Tests done by WP Hive test script Results
Minimal impact on memory usage The memory usage of this plugin is less than the average memory usage of other plugins on WordPress.org + 200KB. Check FAQ for more.
Minimal impact on pagespeed The impact of this plugin on PageSpeed is less than the average impact of other plugins on WordPress.org + 1000 milliseconds
No PHP errors, warning, notices WP Hive automated test found no PHP error while activating this plugin on our server
No Javascript issues WP Hive automated test found no JavaScrip error while activating this plugin on our server
Latest PHP 7.2.16 compatible WP Hive automated test found the plugin fully compatible with the latest version of PHP
Latest WordPress 5.3 compatible WP Hive automated test found the plugin fully compatible with the latest version of WordPress
Optimized database footprint The plugin creates less than 50 database tables
No activation errors WP Hive automated test found no activation error while activating this plugin on our server
No resource errors WP Hive automated test found no resource error/s while trying this plugin on our server
Frequently updated The plugin was not updated at least once in the last 90 days
All the plugins are tested on the same server with exactly same configuration via test script that automatically activates and logs the data WP Hive shows.
All the scripts run on a VPS with 8 CPU cores and 8 GB of RAM.
The test sites are hosted on Google Cloud VM instances, one site/plugin per instance. The machine type is n1-standard-1. The server is a 8 core CPU with 8GB of RAM.
The test sites are hosted on Apache/2 server and they are tested on PHP 7.2.16 & WordPress 5.3.
The database server is MySQL 8.0.15 and the default PHP memory limit is 256MB.
Disclosure: When you buy through affiliate links on this site, WP Hive may earn a commission which we use to keep the site running. Learn more →
About Accordion Shortcodes
Description
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....
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
You can optionally add a unique ID to each of your accordion items and then use that ID in the URL to open that item by default. For example, say you have the following accordions:
autoclose: Sets whether accordion items close automatically when you open the next item. Set autoclose="true/false" on the opening accordion shortcode like this: [accordion autoclose="false"]. Default is true.
openfirst: Sets whether the first accordion item is open by default. This setting will be overridden if openall is set to true. Set openfirst="true/false" on the opening accordion shortcode like this: [accordion openfirst="true"]. Default is false.
openall: Sets whether all accordion items are open by default. It is recommended that this setting be used with clicktoclose. Set openall="true/false" on the opening accordion shortcode like this: [accordion openall="true"]. Default is false.
clicktoclose: Sets whether clicking an open title closes it. Set clicktoclose="true/false" on the opening accordion shortcode like this: [accordion clicktoclose="true"]. Default is false.
scroll: Sets whether to scroll to the title when it’s clicked open. This is useful if you have a lot of content within your accordion items. Set scroll="true/false" on the opening accordion shortcode like this: [accordion scroll="true"]. Default is false. You may also specify an integer for a pixel offset if you’d like the page to scroll further (useful when the site uses a fixed position header navigation). NOTE: Only use pixel offset integers of > 0. If you do not want a scroll offset, but still want scrolling, simply use scroll="true".
class: Sets a custom CSS class for the accordion group or individual accordion items. Set class="your-class-name" on the opening accordion or accordion-item shortcode like this: [accordion class="your-class-name"] or [accordion-item class="your-class-name"]. Added a class to the accordion-item will add the class to the title HTML tag.
tag: Set the global HTML tag to use for all accordion titles. Set tag="h2" on the opening accordion shortcode like this: [accordion tag="h2"]. Default is h3.
semantics: You can change the entire semantic structure of the accordions to use a definition list (dl, dt, dd) by setting semantics="dl" on the opening accordion shortcode like this: [accordion semantics="dl"]. By default the accordion will use div tags for the wrapper and content containers. If you set this option to dl, it is recommended that you do not also use the tag option. This feature is not selectable from the accordion button dialog box and must be added manually.
Advanced Accordion Item Settings
state: Sets the initial state of the accordion item to open or closed. Set state=open or state=closed on the opening accordion item shortcode like this: [accordion-item state=open]. This setting will override all other accordion settings except when linking to an accordion item via ID.
tag: You can also set the HTML tag for the titles of each accordion item individually by adding tag="tagname" to each [accordion-item] shortcode. Make sure to not include the angle brackets around the tag name. Example: to use instead of the default tag: [accordion-item title="Item title" tag="h2"]Item content[/accordion-item]. Using a tag attribute on an individual accordion item will override the global setting. The list of valid tags is: h1, h2, h3, h4, h5, h6, p, div.
usebutons: You can now optionally wrap each accordion item title in a tag by adding usebuttons="true" to the main [accordion] shortcode. Please note that your theme may apply undesirable styles to tags by default. You may need to add more custom styles to override your themes default styles. Using this setting will produce this HTML output:
Drop-down content goes here.
Drop-down content goes here.
Filtering Shortcodes
You can filter the settings and content of the shortcodes by adding some simply code to the functions.php file of your theme.
For example, you could set the openfirst option for all accordions across the entire site using:
add_filter('shortcode_atts_accordion', 'set_accordion_shortcode_defaults', 10, 3);
function set_accordion_shortcode_defaults($atts) {
// Override the openfirst setting here
$atts['openfirst'] = true;
return $atts;
}
Compatibility Mode
If you have a theme that already includes the shortcodes [accordion] or [accordion-item] you can enable compatibility mode.
To enable compatibility mode add define('AS_COMPATIBILITY', true); to your wp-config.php file. This will add a prefix of ‘as-‘ to the two accordion shortcodes.
With compatibility mode enabled, make sure your shortcodes start with as- like this: [as-accordion]...[/as-accordion] and [as-accordion-item]...[/as-accordion-item].
Disable TinyMCE Buttons
You can optionally disable the TinyMCE extension which will remove the buttons from the editor button bar. To disable the TinyMCE extension add define('AS_TINYMCE', false); to your wp-config.php file.
Issues/Suggestions
For bug reports or feature requests or if you’d like to contribute to the plugin you can check everything out on Github.
Want to skyrocket the popularity of your plugin and reach millions of eager users? Look no further than WP Hive. Gain credibility through in-depth reviews, drive conversions with targeted email marketing, and boost visibility with strategic social promotion and exposure
Be Part of the Conversation with WordPress Enthusiasts
Using Accordion Shortcodes? Great, join the conversation now!
Let’s talk about overall quality, ease of use, stellar support, unbeatable value, and the amazing experience Accordion Shortcodes brings to you.