HomeWho We AreContact

WordPress Plugin Javascript CSS Accordion

By Neil Ludlow
Published in Personal Projects
December 22, 2019
1 min read
WordPress Plugin Javascript CSS Accordion

I was having trouble finding a WordPress plugin that would give me an Accordion on a particular WordPress website. Either jQuery was not in the required version range or there was some conflict with one of the other plugins. So, I decided to make my own plugin!

How do I add an Accordion to WordPress?

This plugin is a standalone plugin. It uses pure javascript, not jQuery, so it should work on any WordPress website. Also, the CSS is plain too and does not require any CSS libraries such as Bootstrap.

Here are some examples of an HTML Accordion using this WordPress plugin…

[sdjca id="1" title="hello" content="world"]
[sdjca id="2" title="How can I use an Accordion on my WordPress blog?" content="It's easy with the brand new plugin from Shortdark... Javascript CSS Accordion!!"]

This plugin, at the time of writing is brand new, so it looks like there are some formatting issues on this website, but these will be ironed out shortly.

To find out more and download the plugin see below…

  • Javascript CSS Accordion WordPress plugin page
  • Javascript CSS Accordion code on Github

How do I use the Javascript CSS Accordion plugin?

After installing and activating you need to insert some shortcode into your WordPress post or pages.

The shortcode looks like this…

[sdjca id="" title="" content=""]

So, to use it you might populate it like this…

[sdjca id="1" title="Hello" content="World"]

If you have more than one accordion on a post/page each “id” would need to be unique. So, if the first one has id=“1”, the next one could be id=“2”, and so on.


Tags

#wordpress#javascript#css

Share

Previous Article
Setting up AWS Elastic Beanstalk with Laravel to update with GIT
Next Article
CSS Discussion
Neil Ludlow

Neil Ludlow

Freelance Software Developer

Table Of Contents

1
How do I add an Accordion to WordPress?
2
How do I use the Javascript CSS Accordion plugin?

Related Posts

WordPress Plugin Post Volume Stats
September 15, 2016
4 min
© 2024, All Rights Reserved.
Powered By

Quick Links

About ShortdarkContact

Legal Stuff

Social Media