Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 1.2   Updated Thursday, February 19th, 2009 at 7:19pm

Expanding Text plugin for WordPress

This WordPress plugin allows you to create sections of text in your post or page which expand/collapse when clicked on. You simply wrap the special tags around your text, and set the ‘expand link’ (the link visitors click on to show the text). If your visitors do not have javascript enabled, the ‘expand link’ is not shown, and the text is displayed normally.

Download

  If you have found this page useful, please consider donating. Thanks!

Change Log

  • 02-19-09 Version 1.2 – Changed wrapper tags *must change existing links when updating!* Fixed validation errors, and issues switching between code and html view
  • 10-09-08 Version 1.1 – Now works properly when the exact same expanding text is used more than once on the page
  • 08-14-08 Version 1.0 – First release

Installing

  • Download the above file, rename it from .txt to .php, and upload it to your plugins directory.
  • Enable the plugin.
  • Optional: Add the CSS to your theme’s style sheet to make it look nice (see the customization section below).

Usage

To make your text expand/collapse, use the following format in your post or page:

Important: Make sure you add this using the html/code editor in WordPress, not the visual editor. In new versions of WordPress, just click the ‘html’ button above the edit box. If you use the visual editor it will not work, as the actual code you entered will be seen on the page, instead of being processed by the script.

Notice: If upgrading from version 1.1, make sure you change your existing code to match the examples below. The tags have been changed to cause less issues.

[DDET (expand link text)]
(Text to expand)
[/DDET]

Example:

[DDET Click to expand!]
Here is your text!
[/DDET]

You can add as many sections of expanding text as you like.

Demo

Here you can see the plugin in action:

Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text! Here is your text!

Customization

To style the expanding text boxes, you must add the .ddet_div class to your theme’s css file. Here is an example:

.ddet_div {
  margin: 8px 0 0 12px;
  padding: 8px;
  background: #F4F4F4;
  border: 1px solid #DDDDDD;
}

Pages: [15] 14 13 12 11 10 9 8 7 6 51 » Show All

  1. Just wanted to say “thanks”.

    Have been using your plugin for ages, and not only don’t think I’ve ever had any problems with it, but also it’s one of the few bits of plugin ‘codes’ that I know so well now I can write without checking! :-)

  2. Thanks for this plugin, will help us a lot to improve our PMO.

  3. 222
    SEO Expert

    I implement the “DDET” plugin on my client’s blog and it is working fine. I enjoy it. Thanks a lot!

  4. This WordPress plugin allows you to create sections of text in your post or page which expand/collapse when clicked on. You simply wrap the special tags around your text.

  5. n new versions of WordPress, just click the ‘html’ button above the edit box. If you use the visual editor it will not work, as the actual code you entered will be seen on the page, instead of being processed by the script.

  6. Is it possible to modify the text color/font/size of the “Click to expand!” section? Please provide detailed explanation on how to edit the code.

    thank you.

  7. 218
    Boris

    Thanks! Great plugin — very useful!

  8. That is waht i’m searching for. very helpful!

  9. Hi,
    Is it possible it doesn’t work with newest Wordpress version? Or with certain theme’s?
    Tried almost everything and ain’t working…
    Would be so nice if this would work… searching long time for this.

  10. I LOVE this plugin, I had way too much on my first page of my site, and it was too confusing for visitors. This plugin helped me make it look cleaner while still having the information available on the front page of my blog. Thanks!

  11. You made some good points there. I did a search on the topic and found most people will a

  12. I enjoy visiting this site especially this post. Actually, this can be a big help for me on my ne website.

  13. Great plugin thanks so much :D

  14. Online Low Price, Door to Door Service|

Pages: [15] 14 13 12 11 10 9 8 7 6 51 » Show All

Leave a Comment

Before you comment: If you are having an issue with a script, please make sure you have read the entire article. Also, please read through the comments because most common issues have already been discussed many times. Thanks.


Be sure to wrap all code in <code></code> tags.