WordPress.org

Ready to get started?Download WordPress

Forums

WP-ShowHide
New Plugin! (5 posts)

  1. Lester Chan
    Member
    Plugin Author

    Posted 3 years ago #

    I have created a new plugin, WP-ShowHide. It is a simple plugin (83 lines of codes including comments) with no configuration screen needed.

    It allows you to embed content within your blog post via WordPress ShortCode API and toggling the visibility of the cotent via a link. By default the content is hidden and user will have to click on the “Show Content” link to toggle it. Similar to what Engadget is doing for their press releases.

    Example usage: [showhide type="pressrelease"]Press Release goes in here.[/showhide]

    I tested it on WordPress 3.1.1 but technically it should work with any version higher than WordPress 2.5 because ShortCode was introduced in WordPress 2.5.

    Demo: http://lesterchan.net/wordpress/2011/04/28/wp-showhide-1-00/
    Download: http://downloads.wordpress.org/plugin/wp-showhide.zip
    WP Plugins Page: http://lesterchan.net/portfolio/programming/php/#wp-showhide

    http://wordpress.org/extend/plugins/wp-showhide/

  2. fatcat7060
    Member
    Posted 2 years ago #

    Excellent! It works great except one thing:

    I'd love the link text to say something else besides "Show Press Release".

    I went into the editor, and found "Show Press Release" and, very carefully changed it to what I wanted the link to say - simply "Show the Answer"(it's for a Q & A type page). Once I did that, it crashed, and reported a fatal error and the plugin was deactivated.

    Is it not possible to modify the link text? If so --- how?

    Thanks!

  3. fatcat7060
    Member
    Posted 2 years ago #

    Never mind!

    I see what I did wrong --- it's fine!

    Awesome plugin -- thanks!

  4. fatcat7060
    Member
    Posted 2 years ago #

    I spoke too soon ---

    The above issue is fine.

    But, as I add more "show-hides" on the page, I realize when I click the link, each one shows the exact same text as the first one. Here is what I've done. Following this text, there are similar sets of Q and A, done in this same manner. The problem is, when you click the link for, say, the third question down, it "shows" the answer from the first one. They ALL show the answer from the first one. What am I missing here?

    Q: I'm a new soap maker and recently left pounds of glycerin melt and pour and shea butter melt and pour in my car trunk, which of course made for frozen soap. Is there anything I can do about this?

    [showhide]A: Oooooh man, I hate that. Are you doing individual soap bars? If so, no need to panic. You MIGHT get slightly sweaty soap after heating/molding but no major harm. You might notice a little bit of trouble with layers adhering together as well. If you're doing loaves and need to cut, that's a much much tougher proposition. The soap tends to 'sheer' and break when it gets frozen. The crystalline structure doesn't come back together easily. Water is not your best bet. Liquid Glycerin at 3-5% would be a better choice but if there's any way to be able to just use individual molds, that is your best bet.of course made for frozen soap. Is there anything I can do about this?[/showhide]

  5. fatcat7060
    Member
    Posted 2 years ago #

    Ooops --- again, never mind. Figured it out : )

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic