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: [9] 8 7 6 5 4 3 2 1 » Show All

  1. 135
    D.H.

    Opps, after step 3, you must UPLOAD the php file into “expand-text” directory, if it wasn’t obvious. Der.

  2. This does work perfectly in Wordpress 3.0.1, here’s how to install the plugin:

    1) Save .txt plugin as expand-text.php – Rename the file if necessary
    2) Start up your FTP, go to /wp-content/wp-plugins/
    3) Create a directory called “expand-text” (w/o quotes)
    4) Go to WP-ADMIN web page, click on Plugins
    5) You will see the Plugin as “Expanded Text” but it will be list as Deactivated
    6) Activate plugin
    7) Use as instructed

  3. This plugin seems to stop image verification working on the Form Mailer plugin! When expanding text is activated, the image for verification on Form Mailer pages just shows an image place-holder, not the image!?

  4. doesn’t work for me. Check out my website at http://www.govpoliceimpouncars.com for deals on new cars

  5. 131
    Gopalan

    <?php get_header();?>

    I have a problem in tag’s in my website.

  6. I have included a website link to the test site I am using your plugin for. Any way I can have a + and – image in the corner as a visual. At the moment I have the down arrow but would like to make it an up arrow on expand.

    thanks

  7. 129
    Karan Singhal

    How to you make the link go under the content when it appears? When the content appears when you click the link, how do you make it go above the link?

  8. 128
    Rosana

    I works just fine!!! Thanks a LOT!!!!!!

  9. 127
    Chippa

    seems to work for me in 3.0
    one thing i have noticed is that it doesnt render properly in archives. you can see bits of javascript and all the text in the summary

  10. 126
    Nick

    Please, Please make this work on 3.0

  11. 125
    scott

    this doesn’t seem to work with Wordpress 3.0??

  12. 124
    Rajmohan

    Hello,

    Does the code between DDET and /DDET is crowled by Search Engines or not? I am not sure if any hyperlinks and text between the expanding text plugin will be available to search engines to index or they will be left by engines for being within javascript.

    Can some one clarify this to me?

  13. 123
    Leigh

    RE: Post 108 (Leanne) Good work around. But, would still like to know what’s the problem as I have it as well. Great Plug-In thought!

  14. I´m using your plugin to make an expandable list. Works fantastically well.
    Thanks

  15. Great plugin! I´m using it to make an expandable list. I have struggled to expend my articles in pho code. Now, I can solve my problem using your plugin. Thanks.

Pages: [9] 8 7 6 5 4 3 2 1 » 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.