Expand/Collapse content in WordPress

I am using the plugin “JQuery Collapse-O-Matic” to let the reader expand or collapse parts of my posts…

The documentation is available on the author’s website. As you can see, there are a lot of options to manage groups, scrolling, colors, pictures, etc, etc, etc…

Click to Read More

I mainly use the basic options to display a title to show the content and one to hide it:

[expand title="Click to Read More" swaptitle="Click to Close"]

some content

[/expand]

I found, so far, once issue with the “WordPress 2012” theme I am using:

  • When there is no content anymore after the closing tag, there is no space left between the collapsed block and the bottom line of the post.
  • If there is one blank line after the closing tag, there is a huge space (several lines) displayed between the collapsed block and the bottom line of the post.
However, if you apply the “Align Full” style on the opening tag (only), one blank line will be kept between collapsed block and the bottom line of the post, which makes it more readable. Otherwise, the “link” to expand the block is barely visible.
This issue does also not occur
  • if the opening tag to expand/collapse the block is not at the beginning of the line, i.e.: if there are some text in front of it.
  • if the previous line is not the last one of a paragraph. I.e.: if it ends with a simple line break (Shift-Enter) instead of a end-of-paragraph (Enter).

Copy the code here above and paste it into your post with Ctrl-Shift-V, to paste-in-plain-text (without formatting!)

Loading


Categories:

Tags:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *