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: [16] 15 14 13 12 11 10 9 8 7 61 » Show All

  1. 237
    Rick

    Is anyone experiencing a strange effect using this?

    Suppose you have lines of text where each line is to expand.

    A big space gap (about two lines worth) appears between the first and second line of text with the second line of text having a slightly smaller font.

    Since I don’t have any spaces between the [/DDET] and the next [DDET] in my html, I’m puzzled as to why I get the line spacing. It only happens between the first and second lines.

    Example:

    [DDET My first line]
    blah blah blah
    [/DDET]
    [DDET My second line]
    blah blah blah
    [/DDET]

    I get…

    My first line (looks and works okay)

    My second line (does not show immediately following first line and the font is a little smaller).

    Any thoughts?

    Thanks.

  2. Will this work with the latest release of wordpress?

  3. This is a great plugin that I use on most of my pages. I have wondered if there is a way to use a graphic as a button.

  4. 234
    James

    Hi,

    Great plugin, thankyou so much! :)

    It would be great if you could count the clicks made

    Could you implement this feature.

    Thanks in advance!

  5. 233
    Romero

    If I want to add a expandable list in the sidebar how can I do it?

  6. Love this plugin works like a charm with the latest version of wordpress. I think we should all support Dagon Design and donate, even if it’s a small sum.

  7. This is a great plugin, though of course you need to be able to get it running first. I had some problems with that. Once running I was able to use it for escort templates which worked out nicely.

  8. Hi, great script, works perfectly with 3.3.1!

    One Q, is is possible to use an anchor link and have the text expanded? So you click a link at the top which takes you further down the page to the DDET area and has the text box already open?

    Thanks!

  9. Thanks a lot for the plugin! :)
    I’ve been looking for this all over the web.
    is this compatible with WP 3.3.1?

    Tyler

  10. oakley sunglasses prescription
    when it comes to quality. I have been using ABC for the last 3 years it never disappointed me. Does anybody know when the new version is coming out.

  11. Thank you for an additional fantastic blog.Very cool tool, favicons turn out very high quality. Thanks. Where else might one get that sort of information written in such a perfect way? I actually have a presentation that i am presently working on, and that i are looking for such information instead

  12. 226
    sudheer

    Hi,

    The plugin is wonderful and very useful.. But can you please help me a bit as i was not able to implement this on tabs (quick tabs plugin) its working perfectly from pages but not sure what is wrong inside the tabs (created using “quick tabs” plugin).

    Your help will be highly appreciated.

    Thank you

    Regards,
    Sudheer

Pages: [16] 15 14 13 12 11 10 9 8 7 61 » 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.