https://github.com/bikubi/wp-effortfulaccordion
A WordPress plugin. Transforms content-with-headings into an accordion, tabbed content or columns.
https://github.com/bikubi/wp-effortfulaccordion
accordion bootstrap wordpress wordpress-plugin
Last synced: about 2 months ago
JSON representation
A WordPress plugin. Transforms content-with-headings into an accordion, tabbed content or columns.
- Host: GitHub
- URL: https://github.com/bikubi/wp-effortfulaccordion
- Owner: bikubi
- Created: 2019-04-12T11:29:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-10T10:32:38.000Z (over 3 years ago)
- Last Synced: 2025-09-18T18:42:26.908Z (10 months ago)
- Topics: accordion, bootstrap, wordpress, wordpress-plugin
- Language: PHP
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Effortful Accordion
A WordPress plugin. Transforms content-with-headings into an accordion, tabbed content or columns.
## Config
The plugin looks for a configuration file in your theme, since the layout depends on the theme.
Put it in the most convenient of following places:
```sh
.../wp-content/yourtheme/wp-effortfulaccordion-config.php
.../wp-content/yourtheme/lib/wp-effortfulaccordion-config.php # sage 8
.../wp-content/yourtheme/app/wp-effortfulaccordion-config.php # sage 9
```
## Usage
The main function `content_split`, as well as the Shortcode, take two optional parameters:
1. `mode`, defaults to `accordion`. Check the code for other values and the markup this produces.
2. `h`, which is the HTML heading-level at which the content is split. Range: `1`-`6`, defaults to `2`, meaning "split at `
`s".
##Setup implicit/automatic content transformation
To run, say, on each page, or each page with template Foo, filter `the_content`, running the content through the main function.
See `config-example.php`.
For **accordions**, define your preferred Bootstrap version (3 and 4 are supported) like so:
```php
define('bootstrap_version', 4);
```
If you don't use Bootstrap in your theme, you can `wp_*_enqueue` `effortfulaccordion.js` and `effortfulaccordion.css`, which contain the relevant bits. In this case, `bootstrap_version` must be `3`.
## Explicit content transformation via Shortcode
```html
Content content content.
[accordion mode="accordion" h="2"]
First heading
Content related to the first heading.
Second heading
Content related to the second heading.
[/accordion]
More content content content.
```
## TODO
* Only modes `accordion`, `wrap`, `outerwrap` and `doublewrap` are tested.
* Makefile (?) for effortfulaccordion.scss→css